Mercurial > cpython-lru_cache-weakref
annotate Lib/new.py @ 79675:c0a2294de787 2.7
Issue #16199: Backport 2to3 typo fix from 3.2.
| author | Chris Jerdonek <chris.jerdonek@gmail.com> |
|---|---|
| date | Thu, 11 Oct 2012 16:15:46 -0700 |
| parents | b6bf2a5f49dd |
| children |
| rev | line source |
|---|---|
|
23873
4588b6820a11
Forgot to add this. It's part of patch 568629.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
1 """Create new objects of various types. Deprecated. |
|
4588b6820a11
Forgot to add this. It's part of patch 568629.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
2 |
|
4588b6820a11
Forgot to add this. It's part of patch 568629.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
3 This module is no longer required except for backward compatibility. |
|
4588b6820a11
Forgot to add this. It's part of patch 568629.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
4 Objects of most types can now be created by calling the type object. |
|
4588b6820a11
Forgot to add this. It's part of patch 568629.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
5 """ |
|
46775
816c21c762c8
Deprecate the new module for removal in 3.0.
Brett Cannon <bcannon@gmail.com>
parents:
44038
diff
changeset
|
6 from warnings import warnpy3k |
|
816c21c762c8
Deprecate the new module for removal in 3.0.
Brett Cannon <bcannon@gmail.com>
parents:
44038
diff
changeset
|
7 warnpy3k("The 'new' module has been removed in Python 3.0; use the 'types' " |
|
816c21c762c8
Deprecate the new module for removal in 3.0.
Brett Cannon <bcannon@gmail.com>
parents:
44038
diff
changeset
|
8 "module instead.", stacklevel=2) |
|
816c21c762c8
Deprecate the new module for removal in 3.0.
Brett Cannon <bcannon@gmail.com>
parents:
44038
diff
changeset
|
9 del warnpy3k |
|
23873
4588b6820a11
Forgot to add this. It's part of patch 568629.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
10 |
|
4588b6820a11
Forgot to add this. It's part of patch 568629.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
11 from types import ClassType as classobj |
|
4588b6820a11
Forgot to add this. It's part of patch 568629.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
12 from types import FunctionType as function |
|
4588b6820a11
Forgot to add this. It's part of patch 568629.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
13 from types import InstanceType as instance |
|
4588b6820a11
Forgot to add this. It's part of patch 568629.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
14 from types import MethodType as instancemethod |
|
4588b6820a11
Forgot to add this. It's part of patch 568629.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
15 from types import ModuleType as module |
|
4588b6820a11
Forgot to add this. It's part of patch 568629.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
16 |
|
55744
b6bf2a5f49dd
restricted environments are no more
Benjamin Peterson <benjamin@python.org>
parents:
46775
diff
changeset
|
17 from types import CodeType as code |
