bytecode -> code object

dr. franken misiek at 3w.pl
Thu Sep 14 10:43:39 EDT 2000


The Python C/API manual says:

"""
PyObject* PyImport_ExecCodeModule (char *name, PyObject *co)

Given a module name (...) and a code object read from a Python bytecode file
or obtained from the built-in function compile(), load the module.
"""

I feed Py_CompileString with python source, and I get a code object - fine.
But how do I get a code object from (a string containing) python bytecode?

And another thing - the string methods in python2 is a fine addition, but
how about "join" being a list attribute? Compare the two:

>>>[mylist].join()
>>>"".join(mylist)

I prefer the former one.

--





More information about the Python-list mailing list