diff options
author | Thomas Wouters <thomas@python.org> | 2000-08-24 20:06:04 (GMT) |
---|---|---|
committer | Thomas Wouters <thomas@python.org> | 2000-08-24 20:06:04 (GMT) |
commit | 12bba852a9fabf95442690fce2a7e7975f22f914 (patch) | |
tree | 9018a6b4485617742b020a6c43dc3ab39d987d19 /Doc/lib/libdis.tex | |
parent | b0b7e317096e37bb4e88df22da6d6e6174d12405 (diff) | |
download | cpython-12bba852a9fabf95442690fce2a7e7975f22f914.zip cpython-12bba852a9fabf95442690fce2a7e7975f22f914.tar.gz cpython-12bba852a9fabf95442690fce2a7e7975f22f914.tar.bz2 |
Rough and incomplete documentation on augmented assignment, which follows
shortly. Markup also needs checking.
Diffstat (limited to 'Doc/lib/libdis.tex')
-rw-r--r-- | Doc/lib/libdis.tex | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/Doc/lib/libdis.tex b/Doc/lib/libdis.tex index b89bf3d..593daca 100644 --- a/Doc/lib/libdis.tex +++ b/Doc/lib/libdis.tex @@ -130,6 +130,11 @@ Lifts second and third stack item one position up, moves top down to position three. \end{opcodedesc} +\begin{opcodedesc}{ROT_FOUR}{} +Lifts second, third and forth stack item one position up, moves top down to +position four. +\end{opcodedesc} + \begin{opcodedesc}{DUP_TOP}{} Duplicates the reference on top of the stack. \end{opcodedesc} @@ -209,6 +214,55 @@ Implements \code{TOS = TOS1 \^\ TOS}. Implements \code{TOS = TOS1 | TOS}. \end{opcodedesc} +In-place operations are like binary operations, in that they remove TOS and +TOS1, and push the result back on the stack, but the operation is done +in-place when TOS1 supports it, and the resulting TOS may be (but does not +have to be) the original TOS1. + +\begin{opcodedesc}{INPLACE_POWER}{} +Implements in-place \code{TOS = TOS1 ** TOS}. +\end{opcodedesc} + +\begin{opcodedesc}{INPLACE_MULTIPLY}{} +Implements in-place \code{TOS = TOS1 * TOS}. +\end{opcodedesc} + +\begin{opcodedesc}{INPLACE_DIVIDE}{} +Implements in-place \code{TOS = TOS1 / TOS}. +\end{opcodedesc} + +\begin{opcodedesc}{INPLACE_MODULO}{} +Implements in-place \code{TOS = TOS1 \%{} TOS}. +\end{opcodedesc} + +\begin{opcodedesc}{INPLACE_ADD}{} +Implements in-place \code{TOS = TOS1 + TOS}. +\end{opcodedesc} + +\begin{opcodedesc}{INPLACE_SUBTRACT}{} +Implements in-place \code{TOS = TOS1 - TOS}. +\end{opcodedesc} + +\begin{opcodedesc}{INPLACE_LSHIFT}{} +Implements in-place \code{TOS = TOS1 << TOS}. +\end{opcodedesc} + +\begin{opcodedesc}{INPLACE_RSHIFT}{} +Implements in-place \code{TOS = TOS1 >> TOS}. +\end{opcodedesc} + +\begin{opcodedesc}{INPLACE_AND}{} +Implements in-place \code{TOS = TOS1 \&\ TOS}. +\end{opcodedesc} + +\begin{opcodedesc}{INPLACE_XOR}{} +Implements in-place \code{TOS = TOS1 \^\ TOS}. +\end{opcodedesc} + +\begin{opcodedesc}{INPLACE_OR}{} +Implements in-place \code{TOS = TOS1 | TOS}. +\end{opcodedesc} + The slice opcodes take up to three parameters. \begin{opcodedesc}{SLICE+0}{} @@ -366,6 +420,11 @@ the stack right-to-left. %This opcode is obsolete. %\end{opcodedesc} +\begin{opcodedesc}{DUP_TOPX}{count} +Duplicate \var{count} items, keeping them in the same order. Due to +implementation limits, \var{count} should be between 1 and 5 inclusive. +\end{opcodedesc} + \begin{opcodedesc}{STORE_ATTR}{namei} Implements \code{TOS.name = TOS1}, where \var{namei} is the index of name in \member{co_names}. |