summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>1999-06-17 18:15:07 (GMT)
committerFred Drake <fdrake@acm.org>1999-06-17 18:15:07 (GMT)
commite01978996236ab1a860684cd522604aadcb0d6d7 (patch)
tree51cfa75caa6bf6bb6dd2429e88d5dfc26adbe124 /Doc
parentde69ae1753ec8f7341faa4562b90270b1912404e (diff)
downloadcpython-e01978996236ab1a860684cd522604aadcb0d6d7.zip
cpython-e01978996236ab1a860684cd522604aadcb0d6d7.tar.gz
cpython-e01978996236ab1a860684cd522604aadcb0d6d7.tar.bz2
Correction: the parameters of new.instance() are type-checked.
Edited several of the descriptions for English usage and more consistent style.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/lib/libnew.tex22
1 files changed, 11 insertions, 11 deletions
diff --git a/Doc/lib/libnew.tex b/Doc/lib/libnew.tex
index ffd3568..bf214cb 100644
--- a/Doc/lib/libnew.tex
+++ b/Doc/lib/libnew.tex
@@ -19,39 +19,39 @@ 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}.
+unbound if \var{instance} is \code{None}. \var{function} must be
+callable, and \var{instance} must be 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.
+\var{name} is given, it must be a string or \code{None}. If it is a
+string, the function will have the given name, otherwise the function
+name will be taken from \code{\var{code}.co_name}. If
+\var{argdefs} is given, it must be a tuple and will be used to the
+determine the default values of parameters.
\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
+This function is an interface to the \cfunction{PyCode_New()} C
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.
+\var{name} must 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.
+namespace \var{dict}.
\end{funcdesc}