diff options
Diffstat (limited to 'Doc/reference')
-rw-r--r-- | Doc/reference/datamodel.rst | 8 | ||||
-rw-r--r-- | Doc/reference/simple_stmts.rst | 3 |
2 files changed, 6 insertions, 5 deletions
diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index 57fd63b..502305d 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -317,7 +317,7 @@ Sequences slicing notations can be used as the target of assignment and :keyword:`del` (delete) statements. - There is currently a single intrinsic mutable sequence type: + There are currently two intrinsic mutable sequence types: Lists .. index:: object: list @@ -1777,13 +1777,13 @@ left undefined. object.__ixor__(self, other) object.__ior__(self, other) - These methods are called to implement the augmented arithmetic operations + These methods are called to implement the augmented arithmetic assignments (``+=``, ``-=``, ``*=``, ``/=``, ``//=``, ``%=``, ``**=``, ``<<=``, ``>>=``, ``&=``, ``^=``, ``|=``). These methods should attempt to do the operation in-place (modifying *self*) and return the result (which could be, but does not have to be, *self*). If a specific method is not defined, the augmented - operation falls back to the normal methods. For instance, to evaluate the - expression ``x += y``, where *x* is an instance of a class that has an + assignment falls back to the normal methods. For instance, to execute the + statement ``x += y``, where *x* is an instance of a class that has an :meth:`__iadd__` method, ``x.__iadd__(y)`` is called. If *x* is an instance of a class that does not define a :meth:`__iadd__` method, ``x.__add__(y)`` and ``y.__radd__(x)`` are considered, as with the evaluation of ``x + y``. diff --git a/Doc/reference/simple_stmts.rst b/Doc/reference/simple_stmts.rst index 5793c09..d544990 100644 --- a/Doc/reference/simple_stmts.rst +++ b/Doc/reference/simple_stmts.rst @@ -246,7 +246,8 @@ Augmented assignment is the combination, in a single statement, of a binary operation and an assignment statement: .. productionlist:: - augmented_assignment_stmt: `target` `augop` (`expression_list` | `yield_expression`) + augmented_assignment_stmt: `augtarget` `augop` (`expression_list` | `yield_expression`) + augtarget: `identifier` | `attributeref` | `subscription` | `slicing` augop: "+=" | "-=" | "*=" | "/=" | "//=" | "%=" | "**=" : | ">>=" | "<<=" | "&=" | "^=" | "|=" |