mirror of
https://github.com/python/cpython.git
synced 2025-11-03 03:22:27 +00:00
Correction: the parameters of new.instance() are type-checked.
Edited several of the descriptions for English usage and more consistent style.
This commit is contained in:
parent
de69ae1753
commit
e019789962
1 changed files with 11 additions and 11 deletions
|
|
@ -19,39 +19,39 @@ This function creates an instance of \class{class} with dictionary
|
||||||
\var{dict} without calling the \method{__init__()} constructor. Note that
|
\var{dict} without calling the \method{__init__()} constructor. Note that
|
||||||
this means that there are no guarantees that the object will be in a
|
this means that there are no guarantees that the object will be in a
|
||||||
consistent state.
|
consistent state.
|
||||||
|
|
||||||
Arguments are \emph{not} type-checked, and an incorrectly typed argument
|
|
||||||
will result in undefined behaviour.
|
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{instancemethod}{function, instance, class}
|
\begin{funcdesc}{instancemethod}{function, instance, class}
|
||||||
This function will return a method object, bound to \var{instance}, or
|
This function will return a method object, bound to \var{instance}, or
|
||||||
unbound if \var{instance} is \code{None}. It is checked that
|
unbound if \var{instance} is \code{None}. \var{function} must be
|
||||||
\var{function} is callable, and that \var{instance} is an instance
|
callable, and \var{instance} must be an instance object or
|
||||||
object or \code{None}.
|
\code{None}.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{function}{code, globals\optional{, name\optional{argdefs}}}
|
\begin{funcdesc}{function}{code, globals\optional{, name\optional{argdefs}}}
|
||||||
Returns a (Python) function with the given code and globals. If
|
Returns a (Python) function with the given code and globals. If
|
||||||
\var{name} is given, the function will have the given name. If
|
\var{name} is given, it must be a string or \code{None}. If it is a
|
||||||
\var{argdefs} is given, they will be the function defaults.
|
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}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{code}{argcount, nlocals, stacksize, flags, codestring,
|
\begin{funcdesc}{code}{argcount, nlocals, stacksize, flags, codestring,
|
||||||
constants, names, varnames, filename, name, firstlineno,
|
constants, names, varnames, filename, name, firstlineno,
|
||||||
lnotab}
|
lnotab}
|
||||||
This function is an interface to the \cfunction{PyCode_New()} internal
|
This function is an interface to the \cfunction{PyCode_New()} C
|
||||||
function.
|
function.
|
||||||
XXX This is still undocumented!!!!!!!!!!!
|
XXX This is still undocumented!!!!!!!!!!!
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{module}{name}
|
\begin{funcdesc}{module}{name}
|
||||||
This function returns a new module object with name \var{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}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{classobj}{name, baseclasses, dict}
|
\begin{funcdesc}{classobj}{name, baseclasses, dict}
|
||||||
This function returns a new class object, with name \var{name}, derived
|
This function returns a new class object, with name \var{name}, derived
|
||||||
from \var{baseclasses} (which should be a tuple of classes) and with
|
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}
|
\end{funcdesc}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue