|
Last change
on this file since 389 was 2, checked in by Yuri Dario, 15 years ago |
|
Initial import for vendor code.
|
-
Property svn:eol-style
set to
native
|
|
File size:
706 bytes
|
| Line | |
|---|
| 1 | """Create new objects of various types. Deprecated.
|
|---|
| 2 |
|
|---|
| 3 | This module is no longer required except for backward compatibility.
|
|---|
| 4 | Objects of most types can now be created by calling the type object.
|
|---|
| 5 | """
|
|---|
| 6 | from warnings import warnpy3k
|
|---|
| 7 | warnpy3k("The 'new' module has been removed in Python 3.0; use the 'types' "
|
|---|
| 8 | "module instead.", stacklevel=2)
|
|---|
| 9 | del warnpy3k
|
|---|
| 10 |
|
|---|
| 11 | from types import ClassType as classobj
|
|---|
| 12 | from types import FunctionType as function
|
|---|
| 13 | from types import InstanceType as instance
|
|---|
| 14 | from types import MethodType as instancemethod
|
|---|
| 15 | from types import ModuleType as module
|
|---|
| 16 |
|
|---|
| 17 | # CodeType is not accessible in restricted execution mode
|
|---|
| 18 | try:
|
|---|
| 19 | from types import CodeType as code
|
|---|
| 20 | except ImportError:
|
|---|
| 21 | pass
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.