Cosmetic changes

This commit is contained in:
Guido van Rossum 1994-09-29 10:04:43 +00:00
parent e433c974bc
commit adc940eabf

View file

@ -16,22 +16,25 @@ TupleType = type(())
ListType = type([]) ListType = type([])
DictionaryType = type({}) DictionaryType = type({})
def func(): pass def _f(): pass
FunctionType = type(func) FunctionType = type(_f)
LambdaType = type(lambda: None) # Same as FunctionType
CodeType = type(_f.func_code)
class C: class _C:
def meth(self): pass def _m(self): pass
ClassType = type(C) ClassType = type(_C)
UnboundMethodType = type(C.meth) # Same as MethodType UnboundMethodType = type(_C._m) # Same as MethodType
x = C() _x = _C()
InstanceType = type(x) InstanceType = type(_x)
MethodType = type(x.meth) MethodType = type(_x._m)
BuiltinFunctionType = type(len) # Also used for built-in methods BuiltinFunctionType = type(len)
BuiltinMethodType = type([].append) # Same as BuiltinFunctionType
ModuleType = type(sys) ModuleType = type(sys)
FileType = type(sys.stdin) FileType = type(sys.stdin) # XXX what if it was assigned to?
XRangeType = type(xrange(0)) XRangeType = type(xrange(0))
try: try:
@ -40,4 +43,4 @@ except TypeError:
TracebackType = type(sys.exc_traceback) TracebackType = type(sys.exc_traceback)
FrameType = type(sys.exc_traceback.tb_frame) FrameType = type(sys.exc_traceback.tb_frame)
del sys, func, C, x # These are not for export del sys, _f, _C, _x # Not for export