Ditched '_find_SET()', since it was a no-value-added wrapper around
[python/dscho.git] / Lib / types.py
blob2f4a8d48e48a68d3e9dfd34e14e6a75ad4af9dce
1 """Define names for all type symbols known in the standard interpreter.
3 Types that are part of optional modules (e.g. array) are not listed.
4 """
6 import sys
8 NoneType = type(None)
9 TypeType = type(NoneType)
11 IntType = type(0)
12 LongType = type(0L)
13 FloatType = type(0.0)
14 try:
15 ComplexType = type(complex(0,1))
16 except NameError:
17 pass
19 StringType = type('')
20 BufferType = type(buffer(''))
22 TupleType = type(())
23 ListType = type([])
24 DictType = DictionaryType = type({})
26 def _f(): pass
27 FunctionType = type(_f)
28 LambdaType = type(lambda: None) # Same as FunctionType
29 try:
30 CodeType = type(_f.func_code)
31 except:
32 pass
34 class _C:
35 def _m(self): pass
36 ClassType = type(_C)
37 UnboundMethodType = type(_C._m) # Same as MethodType
38 _x = _C()
39 InstanceType = type(_x)
40 MethodType = type(_x._m)
42 BuiltinFunctionType = type(len)
43 BuiltinMethodType = type([].append) # Same as BuiltinFunctionType
45 ModuleType = type(sys)
47 try:
48 FileType = type(sys.__stdin__)
49 except:
50 pass
51 XRangeType = type(xrange(0))
53 try:
54 raise TypeError
55 except TypeError:
56 try:
57 tb = sys.exc_info()[2]
58 TracebackType = type(tb)
59 FrameType = type(tb.tb_frame)
60 except:
61 pass
62 tb = None; del tb
64 SliceType = type(slice(0))
65 EllipsisType = type(Ellipsis)
67 del sys, _f, _C, _x # Not for export