diff options
author | Georg Brandl <georg@python.org> | 2009-01-18 18:25:30 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-01-18 18:25:30 (GMT) |
commit | fe11f4d524bb08b81a145d19ee023131c80b08e8 (patch) | |
tree | 4562484f207bc0760f08519cab0d487e4940043d | |
parent | af9a97b245432fe26276b993cc4a5a13ed390c62 (diff) | |
download | cpython-fe11f4d524bb08b81a145d19ee023131c80b08e8.zip cpython-fe11f4d524bb08b81a145d19ee023131c80b08e8.tar.gz cpython-fe11f4d524bb08b81a145d19ee023131c80b08e8.tar.bz2 |
#4986: augassigns are not expressions.
-rw-r--r-- | Doc/reference/datamodel.rst | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index 01fde3e..dbcc9a1 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -2084,13 +2084,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``. |