You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Call of njitted-function f() works and prints correct answer. Call of jitted-function g() (in object mode) with same call of __add__ prints exception AttributeError: 'C' object has no attribute '__add__'. Same exception is printed for the following not-jitted code C(7).__add__(C(11)). Seems that this __add__ method is somehow removed from class for jit/no-jit case.
And finally code C(3) + C(5) works nowhere, not in njit, not in jit, not in unjitted code. It prints error TypeError: unsupported operand type(s) for +: 'C' and 'C' (for jit/no-jit) and long error dump for njit. It means python doesn't detect __add__ method as special method that implements + operator.
Regular methods of jitclass (without special __ ... __ underscores) work correctly in njit/jit/no-jit cases.
Probably it is not a bug but unimplemented feature of yet experimental jitclass.
The text was updated successfully, but these errors were encountered:
Reporting a bug
Seems that jitclass works incorrectly with all special methods like
__add__
,__mul__
, etc. Minimal reproducible example:Call of njitted-function f() works and prints correct answer. Call of jitted-function g() (in object mode) with same call of
__add__
prints exceptionAttributeError: 'C' object has no attribute '__add__'
. Same exception is printed for the following not-jitted codeC(7).__add__(C(11))
. Seems that this__add__
method is somehow removed from class for jit/no-jit case.And finally code
C(3) + C(5)
works nowhere, not innjit
, not injit
, not in unjitted code. It prints errorTypeError: unsupported operand type(s) for +: 'C' and 'C'
(for jit/no-jit) and long error dump for njit. It means python doesn't detect__add__
method as special method that implements+
operator.Regular methods of jitclass (without special
__ ... __
underscores) work correctly in njit/jit/no-jit cases.Probably it is not a bug but unimplemented feature of yet experimental jitclass.
The text was updated successfully, but these errors were encountered: