n | |
| :mod:`new` --- Creation of runtime internal objects |
| =================================================== |
| |
| .. module:: new |
| :synopsis: Interface to the creation of runtime implementation objects. |
n | :deprecated: |
| |
| .. deprecated:: 2.6 |
| The :mod:`new` module has been removed in Python 3.0. Use the :mod:`types` |
| module's classes instead. |
| |
| .. sectionauthor:: Moshe Zadka <moshez@zadka.site.co.il> |
| |
| |
| The :mod:`new` module allows an interface to the interpreter object creation |
| functions. This is for use primarily in marshal-type functions, when a new |
| object needs to be created "magically" and not by using the regular creation |
| functions. This module provides a low-level interface to the interpreter, so |
n | care must be exercised when using this module. It is possible to supply non- |
n | care must be exercised when using this module. It is possible to supply |
| sensical arguments which crash the interpreter when the object is used. |
| non-sensical arguments which crash the interpreter when the object is used. |
| |
| The :mod:`new` module defines the following functions: |
| |
| |
| .. function:: instance(class[, dict]) |
| |
| This function creates an instance of *class* with dictionary *dict* without |
| calling the :meth:`__init__` constructor. If *dict* is omitted or ``None``, a |
| values of parameters. If *closure* is given, it must be ``None`` or a tuple of |
| cell objects containing objects to bind to the names in ``code.co_freevars``. |
| |
| |
| .. function:: code(argcount, nlocals, stacksize, flags, codestring, constants, names, varnames, filename, name, firstlineno, lnotab) |
| |
| This function is an interface to the :cfunc:`PyCode_New` C function. |
| |
t | .. % XXX This is still undocumented!!!!!!!!!!! |
t | .. XXX This is still undocumented! |
| |
| |
| .. function:: module(name[, doc]) |
| |
| This function returns a new module object with name *name*. *name* must be a |
| string. The optional *doc* argument can have any type. |
| |
| |