Code Objects - Python 2.7.18 documentation 编辑
Code objects are a low-level detail of the CPython implementation. Each one represents a chunk of executable code that hasn’t yet been bound into a function.
PyCodeObject
The C structure of the objects used to describe code objects. The fields of this type are subject to change at any time.
- PyTypeObject
PyCode_Type
This is an instance of
PyTypeObject
representing the Pythoncode
type.
- int
PyCode_GetNumFree
(PyObject *co) Return the number of free variables in co.
- PyCodeObject *
PyCode_New
(int argcount, int nlocals, int stacksize, int flags, PyObject *code, PyObject *consts, PyObject *names, PyObject *varnames, PyObject *freevars, PyObject *cellvars, PyObject *filename, PyObject *name, int firstlineno, PyObject *lnotab) Return a new code object. If you need a dummy code object to create a frame, use
PyCode_NewEmpty()
instead. CallingPyCode_New()
directly can bind you to a precise Python version since the definition of the bytecode changes often.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论