Class emulating numeric behaviour with Pint quantities #1903
-
I wrote a custom Point class which I'd like to work with Pint quantities but I get a strange error if I try to emulate numeric behaviour:
Any clue? Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
add Point to pint.compat.upcast_type_map see #1888 |
Beta Was this translation helpful? Give feedback.
-
I did
but nothing changes. |
Beta Was this translation helpful? Give feedback.
-
try |
Beta Was this translation helpful? Give feedback.
-
In this specific MWE the last above solution works, but in my actual code Pint is not imported in the same script where class Point is defined but in a separate module
to |
Beta Was this translation helpful? Give feedback.
Run type(object) and it will give the string you should use. For the example above I did