ariovistus / pyd

Interoperability between Python and D
MIT License
159 stars 32 forks source link

trying to overload division #130

Closed pedrozudo closed 4 years ago

pedrozudo commented 4 years ago

Hi I am trying to overload the division operator in python for two objects of a wrapped D class. Something seems to be going wrong with this nb_divide property. Other operators like + work like a charm. Is there anything extra I have to add for the division?

/usr/local/lib/python3.6/dist-packages/pyd/infrastructure/pyd/class_wrap.d-mixin-1259(1259): Error: no property nb_divide for type deimos.python.object.PyNumberMethods*
/usr/local/lib/python3.6/dist-packages/pyd/infrastructure/pyd/class_wrap.d(1598): Error: template instance pyd.class_wrap.Operators!(BinaryOperatorX!("+", false, Guess), BinaryOperatorX!("-", false, Guess), BinaryOperatorX!("*", false, Guess), BinaryOperatorX!("/", false, Guess), BinaryOperatorX!("^^", false, Guess)).Operators.call!(PsiExpr) error instantiating
/usr/local/lib/python3.6/dist-packages/pyd/infrastructure/pyd/class_wrap.d(1529):        instantiated from here: _wrap_class!(PsiExpr, "PsiExpr", "", "", Init!(DExpr), Def!(simplify), BinaryOperatorX!("+", false, Guess), BinaryOperatorX!("-", false, Guess), BinaryOperatorX!("*", false, Guess), Property!(nb_divide), BinaryOperatorX!("/", false, Guess), BinaryOperatorX!("^^", false, Guess), Repr!(toString))
psipy/psipy.d(73):        instantiated from here: wrap_class!(PsiExpr, Init!(DExpr), Def!(simplify), BinaryOperatorX!("+", false, Guess), BinaryOperatorX!("-", false, Guess), BinaryOperatorX!("*", false, Guess), Property!(nb_divide), BinaryOperatorX!("/", false, Guess), BinaryOperatorX!("^^", false, Guess), Repr!(toString))