diff options
author | Fred Drake <fdrake@acm.org> | 1999-06-17 15:11:35 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 1999-06-17 15:11:35 (GMT) |
commit | 64bc94e3ec72780c27b39f8298b0e1b6af1d5e4e (patch) | |
tree | 54532b2bd1198e1fe626a1842574208535299138 /Doc/lib/libnew.tex | |
parent | 668213d3b8876a30c5cec84a0d07590374495aba (diff) | |
download | cpython-64bc94e3ec72780c27b39f8298b0e1b6af1d5e4e.zip cpython-64bc94e3ec72780c27b39f8298b0e1b6af1d5e4e.tar.gz cpython-64bc94e3ec72780c27b39f8298b0e1b6af1d5e4e.tar.bz2 |
New module documentation sections from Moshe Zadka <moshez@math.huji.ac.il>!
Diffstat (limited to 'Doc/lib/libnew.tex')
-rw-r--r-- | Doc/lib/libnew.tex | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/Doc/lib/libnew.tex b/Doc/lib/libnew.tex new file mode 100644 index 0000000..ffd3568 --- /dev/null +++ b/Doc/lib/libnew.tex @@ -0,0 +1,57 @@ +\section{\module{new} --- + Runtime implementation object creation} + +\declaremodule{builtin}{new} +\sectionauthor{Moshe Zadka}{mzadka@geocities.com} +\modulesynopsis{Interface to the creation of runtime implementation objects.} + + +The \module{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 care must be exercised when using this module. + +The \module{new} module defines the following functions: + +\begin{funcdesc}{instance}{class, dict} +This function creates an instance of \class{class} with dictionary +\var{dict} without calling the \method{__init__()} constructor. Note that +this means that there are no guarantees that the object will be in a +consistent state. + +Arguments are \emph{not} type-checked, and an incorrectly typed argument +will result in undefined behaviour. +\end{funcdesc} + +\begin{funcdesc}{instancemethod}{function, instance, class} +This function will return a method object, bound to \var{instance}, or +unbound if \var{instance} is \code{None}. It is checked that +\var{function} is callable, and that \var{instance} is an instance +object or \code{None}. +\end{funcdesc} + +\begin{funcdesc}{function}{code, globals\optional{, name\optional{argdefs}}} +Returns a (Python) function with the given code and globals. If +\var{name} is given, the function will have the given name. If +\var{argdefs} is given, they will be the function defaults. +\end{funcdesc} + +\begin{funcdesc}{code}{argcount, nlocals, stacksize, flags, codestring, + constants, names, varnames, filename, name, firstlineno, + lnotab} +This function is an interface to the \cfunction{PyCode_New()} internal +function. +XXX This is still undocumented!!!!!!!!!!! +\end{funcdesc} + +\begin{funcdesc}{module}{name} +This function returns a new module object with name \var{name}. +\var{name} should be a string. +\end{funcdesc} + +\begin{funcdesc}{classobj}{name, baseclasses, dict} +This function returns a new class object, with name \var{name}, derived +from \var{baseclasses} (which should be a tuple of classes) and with +namespace \var{dict}. All parameters are type checked. +\end{funcdesc} |