Register   Login   About   Study   Enterprise   Share
AI / Internet Technology University (AITU)
Fast Login - available after registration







|

Top Links: >> 80. Technology >> Internet Technology Summit Program >> 9. AI with Python >> 9.1. The Python Tutorial Introduction >> 9.1.1. Python Docs, Lexicon, and Components >> 9.1.1.3. Python Internals
Current Topic: 9.1.1.3.24. Code Objects
You have a privilege to create a quiz (QnA) related to this subject and obtain creativity score...

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 Python code type.






int
PyCode_Check
(
PyObject
 *co
)



Return true if co is a code object.






int
PyCode_GetNumFree
(
PyCodeObject
 *co
)



Return the number of free variables in co.






PyCodeObject*
PyCode_New
(int
 argcount, int
 kwonlyargcount, int
 nlocals, int
 stacksize, int
 flags,
PyObject
 *code,
PyObject
 *consts,
PyObject
 *names,
PyObject
 *varnames,
PyObject
 *freevars,
PyObject
 *cellvars,
PyObject
 *filename,
PyObject
Was it clear so far?

 *name, int
 firstlineno,
PyObject
 *lnotab
)



Return value: New reference.

Return a new code object. If you need a dummy code object to create a frame, use PyCode_NewEmpty() instead. Calling PyCode_New() directly can bind you to a precise Python version since the definition of the bytecode changes often.






PyCodeObject*
PyCode_NewWithPosOnlyArgs
(int
 argcount, int
 posonlyargcount, int
 kwonlyargcount, 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 value: New reference.

Similar to PyCode_New(), but with an extra ?posonlyargcount? for positional-only arguments.



New in version 3.8.







PyCodeObject*
PyCode_NewEmpty
(const char
 *filename, const char
 *funcname, int
 firstlineno
)



Return value: New reference.

Return a new empty code object with the specified filename, function name, and first line number. It is illegal to exec() or eval() the resulting code object.








Topic Graph | Check Your Progress | Propose QnA | Have a question or comments for open discussion?

Have a suggestion? - shoot an email
Looking for something special? - Talk to me
Read: IT of the future: AI and Semantic Cloud Architecture | Fixing Education
Do you want to move from theory to practice and become a magician? Learn and work with us at Internet Technology University (ITU) - JavaSchool.com.

Technology that we offer and How this works: English | Spanish | Russian | French

Internet Technology University | JavaSchool.com | Copyrights © Since 1997 | All Rights Reserved
Patents: US10956676, US7032006, US7774751, US7966093, US8051026, US8863234
Including conversational semantic decision support systems (CSDS) and bringing us closer to The message from 2040
Privacy Policy