From cf370fb504d2d9b43c4e1e53bcd2d8a3dcd7353c Mon Sep 17 00:00:00 2001 From: Emmanuel Julien Date: Mon, 22 Feb 2016 14:54:19 +0100 Subject: 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. --- Source/Modules/python.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Source') 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); -- cgit v1.2.1