Python源码学习(六)-PyCodeObject初探
demo1.py
type:<class 'code'>dir(co):['__class__', '__delattr__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__le__', '__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'co_argcount', 'co_cellvars', 'co_code', 'co_consts', 'co_filename', 'co_firstlineno', 'co_flags', 'co_freevars', 'co_kwonlyargcount', 'co_lnotab', 'co_name', 'co_names', 'co_nlocals', 'co_stacksize', 'co_varnames']co.co_name:<module>co.co_names:fab------------------------------co.co_code:b'd\x00\x00\x84\x00\x00Z\x00\x00d\x01\x00Z\x01\x00d\x02\x00Z\x02\x00e\x00\x00\x83\x00\x00\x01d\x03\x00S'------------------------------co.co_consts:<code object f at 0x00C0D2F0, file "demo1.py", line 1>95None------------------------------co.co_filename:demo1.py------------------------------co.nlocals:0------------------------------co.co_stacksize:1co.co_lnotab;b'\t\x04\x06\x01\x06\x01'------------------------------co.co_varnames: