Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 691d4ec

Browse files
committed
a fe more things: apply 3rd arg, ni, ihooks, rexec
1 parent 8476d00 commit 691d4ec

2 files changed

Lines changed: 62 additions & 2 deletions

File tree

Doc/tut.tex

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3625,10 +3625,29 @@ \section{Keyword Arguments}
36253625
sketch : Cheese Shop Sketch
36263626
\end{verbatim}
36273627

3628-
Side effects of this change include:
3628+
Consequences of this change include:
36293629

36303630
\begin{itemize}
36313631

3632+
\item
3633+
The built-in function \code{apply()} now has an optional third
3634+
argument, which is a dictionary specifying any keyword arguments to be
3635+
passed. For example,
3636+
\begin{verbatim}
3637+
apply(parrot, (), {'voltage': 20, 'action': 'voomm'})
3638+
\end{verbatim}
3639+
is equivalent to
3640+
\begin{verbatim}
3641+
parrot(voltage=20, action='voomm')
3642+
\end{verbatim}
3643+
3644+
\item
3645+
There is also a mechanism for functions and methods defined in an
3646+
extension module (i.e., implemented in C or C++) to receive a
3647+
dictionary of their keyword arguments. By default, such functions do
3648+
not accept keyword arguments, since the argument names are not
3649+
available to the interpreter.
3650+
36323651
\item
36333652
In the effort of implementing keyword arguments, function and
36343653
especially method calls have been sped up significantly -- for a
@@ -3748,6 +3767,17 @@ \section{Library Changes}
37483767

37493768
\begin{itemize}
37503769

3770+
\item
3771+
There are new module \code{ni} and \code{ihooks} that support
3772+
importing modules with hierarchical names such as \code{A.B.C}. This
3773+
is enabled by writing \code{import ni; ni.ni()} at the very top of the
3774+
main program. These modules are amply documented in the Python
3775+
source.
3776+
3777+
\item
3778+
The module \code{rexec} has been rewritten (incompatibly) to define a
3779+
class and to use \code{ihooks}.
3780+
37513781
\item
37523782
The \code{string.split()} and \code{string.splitfields()} functions
37533783
are now the same function (the presence or absence of the second

Doc/tut/tut.tex

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3625,10 +3625,29 @@ \section{Keyword Arguments}
36253625
sketch : Cheese Shop Sketch
36263626
\end{verbatim}
36273627

3628-
Side effects of this change include:
3628+
Consequences of this change include:
36293629

36303630
\begin{itemize}
36313631

3632+
\item
3633+
The built-in function \code{apply()} now has an optional third
3634+
argument, which is a dictionary specifying any keyword arguments to be
3635+
passed. For example,
3636+
\begin{verbatim}
3637+
apply(parrot, (), {'voltage': 20, 'action': 'voomm'})
3638+
\end{verbatim}
3639+
is equivalent to
3640+
\begin{verbatim}
3641+
parrot(voltage=20, action='voomm')
3642+
\end{verbatim}
3643+
3644+
\item
3645+
There is also a mechanism for functions and methods defined in an
3646+
extension module (i.e., implemented in C or C++) to receive a
3647+
dictionary of their keyword arguments. By default, such functions do
3648+
not accept keyword arguments, since the argument names are not
3649+
available to the interpreter.
3650+
36323651
\item
36333652
In the effort of implementing keyword arguments, function and
36343653
especially method calls have been sped up significantly -- for a
@@ -3748,6 +3767,17 @@ \section{Library Changes}
37483767

37493768
\begin{itemize}
37503769

3770+
\item
3771+
There are new module \code{ni} and \code{ihooks} that support
3772+
importing modules with hierarchical names such as \code{A.B.C}. This
3773+
is enabled by writing \code{import ni; ni.ni()} at the very top of the
3774+
main program. These modules are amply documented in the Python
3775+
source.
3776+
3777+
\item
3778+
The module \code{rexec} has been rewritten (incompatibly) to define a
3779+
class and to use \code{ihooks}.
3780+
37513781
\item
37523782
The \code{string.split()} and \code{string.splitfields()} functions
37533783
are now the same function (the presence or absence of the second

0 commit comments

Comments
 (0)