diff options
author | Emmanuel Julien <e.julien.niji@gmail.com> | 2016-02-22 14:54:19 +0100 |
---|---|---|
committer | Emmanuel Julien <e.julien.niji@gmail.com> | 2016-02-22 14:54:19 +0100 |
commit | cf370fb504d2d9b43c4e1e53bcd2d8a3dcd7353c (patch) | |
tree | 0ab4ef4ba6d29dff45655468a82340ba71921a22 /Source | |
parent | 6fca1ee0b0807132c850d1bc621b5b710fe14978 (diff) | |
download | swig-cf370fb504d2d9b43c4e1e53bcd2d8a3dcd7353c.tar.gz |
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.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/Modules/python.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/Modules/python.cxx b/Source/Modules/python.cxx index 039623e62..055d5a89c 100644 --- a/Source/Modules/python.cxx +++ b/Source/Modules/python.cxx @@ -3716,9 +3716,9 @@ public: printSlot(f, getSlot(n, "feature:python:nb_inplace_xor"), "nb_inplace_xor", "binaryfunc"); printSlot(f, getSlot(n, "feature:python:nb_inplace_or"), "nb_inplace_or", "binaryfunc"); printSlot(f, getSlot(n, "feature:python:nb_floor_divide"), "nb_floor_divide", "binaryfunc"); - printSlot(f, getSlot(n, "feature:python:nb_true_divide"), "nb_true_divide", "binaryfunc"); + printSlot(f, getSlot(n, "feature:python:nb_divide"), "nb_true_divide", "binaryfunc"); printSlot(f, getSlot(n, "feature:python:nb_inplace_floor_divide"), "nb_inplace_floor_divide", "binaryfunc"); - printSlot(f, getSlot(n, "feature:python:nb_inplace_true_divide"), "nb_inplace_true_divide", "binaryfunc"); + printSlot(f, getSlot(n, "feature:python:nb_inplace_divide"), "nb_inplace_true_divide", "binaryfunc"); Printv(f, "#if PY_VERSION_HEX >= 0x02050000\n", NIL); printSlot(f, getSlot(n, "feature:python:nb_index"), "nb_index", "unaryfunc"); Printv(f, "#endif\n", NIL); |