Commit graph

2 commits

Author SHA1 Message Date
Emmanuel Julien
cf370fb504 Fix class member division operator.
Define the nb_divide/nb_inplace_divide slots in the interface and use it them as nb_divide/nb_inplace_divide for Python 2.x and as nb_true_divide/nb_inplace_trus_divide for Python 3.x.

The Python 3.x nb_floor_divide/nb_inplace_floor_divide slots (operator // in Python) are not populated by the interface.
2016-02-22 14:54:19 +01:00
Emmanuel Julien
779ed2cd7a Implement the operator overload test suite for Python.
This suite fails on Python 3 (with and without -builtin) due to the following issues:

- Operator / is mapped to the div slot which is now truediv in Python3 (see PR #136 for a WIP fix).
- Operators +=, -=, *= and probably others assign the method return type (void) to the object they are applied on. A workaround is to return *this from the affected operators.
2016-02-19 00:18:39 +01:00