boostorg / boostorg/python

Division assignment operator (/=) is not exported properly to Python3

Ouverte
#317 2 commentaires 1 réaction 0 personnes assignées Voir sur GitHub
Langage dominant
C++
Étoiles
537
Forks
223
Merge moyen
11 h 22 min
PR mergées (30 j)
2

Description

The minimal example I have is for g++8.3.0 and boost1.67 on Ubuntu19.04 (although I have tested boost1.74 on a CentOS7.8 platform).

My understanding of the issue is that when the operator "/=" is exported for Python3, it is binded to \_\_idiv__ and not \_\_itruediv__, therefore causing a crash upon runtime. For Python2, there is no problem observed.

The problem solved by explicitly doing .def("\_\_itruediv__", &Foo::operator/=). Is this a desired behaviour?

PS:
Compiling on Ubuntu19.04 as:
g++ foo.cpp -Wall -Wextra -shared -fPIC -o myModule.so -Wfatal-errors -I/usr/include/python3.7 -lboost_python3 (boost1.67 library and boost1.67-dev installed from packages).

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.