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
{{ message }}
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.
In current implementation, GenericType does not inherit from any other class, and for that reason has to implement its own operators methods, like __add__ etc...
The problem is that this leads to possible mistakes (like in the current definition of __lt__ - see bellow), and also forbid GenericType s from being used with operators that are not included in the definition (like with __int__, or __mod__).
A much simpler solution is to make it inherit from python primitive types, as proposed here: #198 (comment) .
current problems:
>>> a = GenericType(2)
>>> a > a
True
>>> int(a)
TypeError: int() argument must be a string, a bytes-like object or a number, not 'GenericType'
>>> a // 2
TypeError: unsupported operand type(s) for //: 'GenericType' and 'int'
The text was updated successfully, but these errors were encountered:
In current implementation,
GenericType
does not inherit from any other class, and for that reason has to implement its own operators methods, like__add__
etc...The problem is that this leads to possible mistakes (like in the current definition of
__lt__
- see bellow), and also forbidGenericType
s from being used with operators that are not included in the definition (like with__int__
, or__mod__
).A much simpler solution is to make it inherit from python primitive types, as proposed here: #198 (comment) .
current problems:
The text was updated successfully, but these errors were encountered: