'new' module/extension?

Tim Peters tim_one at email.msn.com
Sat Aug 12 20:28:33 EDT 2000


[Alex Martelli]
> Can somebody suggest an URL documenting the module
> called 'new'?

    http://www.python.org/doc/current/lib/module-new.html

> I can see it used in several win32 .py files,
> and it seems to be tested in a file called test_new.py, but
> I can't find it anywhere in the docs.  Thanks!

It used to be deliberately undocumented, for this reason:

>>> import new
>>> print new.__doc__
Functions to create new objects used by the interpreter.

You need to know a great deal about the interpreter to use this!
>>>

"new" exposes some of Python's deeper and undocumented internals, and it's
easy to throw the interpreter into an insane state by using the module
functions incorrectly.  OTOH, if you need to build a new raw code object,
and know exactly what to do with each of new.code()'s twelve undocumented
arguments, it's the cat's pajamas <wink>.






More information about the Python-list mailing list