This commit was manufactured by cvs2svn to create tag 'cnrisync'.
[python/dscho.git] / Lib / types.py
blobb6841735ce74c3523877dfab6e29603139c2cb32
1 # Define names for all type symbols known in the standard interpreter.
2 # Types that are part of optional modules (e.g. array) are not listed.
4 import sys
6 NoneType = type(None)
7 TypeType = type(NoneType)
9 IntType = type(0)
10 LongType = type(0L)
11 FloatType = type(0.0)
12 try:
13 ComplexType = type(complex(0,1))
14 except NameError:
15 pass
17 StringType = type('')
19 TupleType = type(())
20 ListType = type([])
21 DictType = DictionaryType = type({})
23 def _f(): pass
24 FunctionType = type(_f)
25 LambdaType = type(lambda: None) # Same as FunctionType
26 CodeType = type(_f.func_code)
28 class _C:
29 def _m(self): pass
30 ClassType = type(_C)
31 UnboundMethodType = type(_C._m) # Same as MethodType
32 _x = _C()
33 InstanceType = type(_x)
34 MethodType = type(_x._m)
36 BuiltinFunctionType = type(len)
37 BuiltinMethodType = type([].append) # Same as BuiltinFunctionType
39 ModuleType = type(sys)
41 FileType = type(sys.stdin) # XXX what if it was assigned to?
42 XRangeType = type(xrange(0))
44 try:
45 raise TypeError
46 except TypeError:
47 TracebackType = type(sys.exc_traceback)
48 FrameType = type(sys.exc_traceback.tb_frame)
50 del sys, _f, _C, _x # Not for export