diff options
author | Stefan Behnel <stefan_ml@behnel.de> | 2020-07-10 11:46:47 +0200 |
---|---|---|
committer | Stefan Behnel <stefan_ml@behnel.de> | 2020-07-22 22:58:36 +0200 |
commit | d69092a776ec06766efcd76c23a6f6abd6298b7c (patch) | |
tree | 5bcea93aff10abf967d769c29fb9e6b48228adaf | |
parent | 9cb557c37332ae50bfdbd675409c690cdd5fd908 (diff) | |
download | cython-d69092a776ec06766efcd76c23a6f6abd6298b7c.tar.gz |
Clarify changelog entry on ways to deal with the incompatible binop method change.
-rw-r--r-- | CHANGES.rst | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/CHANGES.rst b/CHANGES.rst index cfd0bec44..a6d55de35 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -11,9 +11,12 @@ Features added * Special methods for binary operators now follow Python semantics. Rather than e.g. a single ``__add__`` method for cdef classes, where "self" can be either the first or second argument, one can now define - both ``__add__`` and ``__radd__`` as for standard Python classes . + both ``__add__`` and ``__radd__`` as for standard Python classes. This behavior can be disabled with the ``c_api_binop_methods`` directive - to return to the previous semantics in Cython code. + to return to the previous semantics in Cython code (available from Cython + 0.29.20), or the reversed method (``__radd__``) can be implemented in + addition to an existing two-sided operator method (``__add__``) to get a + backwards compatible implementation. (Github issue #2056) * No/single argument functions now accept keyword arguments by default in order |