Kaydet (Commit) adc940ea authored tarafından Guido van Rossum's avatar Guido van Rossum

Cosmetic changes

üst e433c974
...@@ -16,22 +16,25 @@ TupleType = type(()) ...@@ -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
class C: CodeType = type(_f.func_code)
def meth(self): pass
ClassType = type(C) class _C:
UnboundMethodType = type(C.meth) # Same as MethodType def _m(self): pass
x = C() ClassType = type(_C)
InstanceType = type(x) UnboundMethodType = type(_C._m) # Same as MethodType
MethodType = type(x.meth) _x = _C()
InstanceType = type(_x)
BuiltinFunctionType = type(len) # Also used for built-in methods MethodType = type(_x._m)
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: ...@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment