annotate Lib/new.py @ 58925:eecf1bef052d 2.6

Merged revisions 78207 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r78207 | ezio.melotti | 2010-02-17 01:26:09 +0200 (Wed, 17 Feb 2010) | 1 line #7930: fix stripid ........
author Ezio Melotti <ezio.melotti@gmail.com>
date Tue, 16 Feb 2010 23:29:44 +0000
parents 816c21c762c8
children b6bf2a5f49dd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
4588b6820a11 Forgot to add this. It's part of patch 568629.
Guido van Rossum <guido@python.org>
parents:
diff changeset
17 # CodeType is not accessible in restricted execution mode
4588b6820a11 Forgot to add this. It's part of patch 568629.
Guido van Rossum <guido@python.org>
parents:
diff changeset
18 try:
4588b6820a11 Forgot to add this. It's part of patch 568629.
Guido van Rossum <guido@python.org>
parents:
diff changeset
19 from types import CodeType as code
4588b6820a11 Forgot to add this. It's part of patch 568629.
Guido van Rossum <guido@python.org>
parents:
diff changeset
20 except ImportError:
4588b6820a11 Forgot to add this. It's part of patch 568629.
Guido van Rossum <guido@python.org>
parents:
diff changeset
21 pass