blob: 1a5c11f2f3446cade653014ff43034e653b4a9af [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"""
Christian Heimes28104c52007-11-27 23:16:44 +00006from warnings import warnpy3k as _warnpy3k
7_warnpy3k("The 'new' module is not supported in 3.x, use the 'types' module "
8 "instead.", stacklevel=2)
Guido van Rossum94c9d902002-06-16 01:22:13 +00009
10from types import ClassType as classobj
11from types import FunctionType as function
12from types import InstanceType as instance
13from types import MethodType as instancemethod
14from types import ModuleType as module
15
16# CodeType is not accessible in restricted execution mode
17try:
18 from types import CodeType as code
19except ImportError:
20 pass