blob: e5f964f87e007f591be4a4ccda333f0bebe8f943 [file] [log] [blame]
Guido van Rossum94c9d902002-06-16 01:22:13 +00001"""Create new objects of various types. Deprecated.
2
3This module is no longer required except for backward compatibility.
4Objects of most types can now be created by calling the type object.
5"""
Brett Cannond7265d62008-05-09 05:18:40 +00006from warnings import warnpy3k
7warnpy3k("The 'new' module has been removed in Python 3.0; use the 'types' "
8 "module instead.", stacklevel=2)
9del warnpy3k
Guido van Rossum94c9d902002-06-16 01:22:13 +000010
11from types import ClassType as classobj
12from types import FunctionType as function
13from types import InstanceType as instance
14from types import MethodType as instancemethod
15from types import ModuleType as module
16
17# CodeType is not accessible in restricted execution mode
18try:
19 from types import CodeType as code
20except ImportError:
21 pass