blob: 531d4050e7cc3b004569a3c01820c4f41092bf42 [file] [log] [blame]
Guido van Rossum85d89451994-06-23 11:53:27 +00001# 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.
3
4import sys
5
6NoneType = type(None)
7TypeType = type(NoneType)
8
9IntType = type(0)
10LongType = type(0L)
11FloatType = type(0.0)
12
13StringType = type('')
14
15TupleType = type(())
16ListType = type([])
17DictionaryType = type({})
18
19def func(): pass
20FunctionType = type(func)
21
22class C:
23 def meth(self): pass
24ClassType = type(C)
25UnboundMethodType = type(C.meth) # Same as MethodType
26x = C()
27InstanceType = type(x)
28MethodType = type(x.meth)
29
30BuiltinFunctionType = type(len) # Also used for built-in methods
31
32ModuleType = type(sys)
33
34FileType = type(sys.stdin)
35XRangeType = type(xrange(0))
36
37try:
38 raise TypeError
39except TypeError:
40 TracebackType = type(sys.exc_traceback)
41 FrameType = type(sys.exc_traceback.tb_frame)
42
43del sys, func, C, x # These are not for export