Closed jurasofish closed 4 years ago
I should note that I opted not to use NotImplemented
in the arithmetic functions. This allows the library to retain tighter control over operator overloading. Otherwise, for example, >= constraints could be flipped to <= constraints if the type is not supported in __ge__
. This might not be desirable.
Previously types were not enforced when adding, multiplying etc. This could easily lead to users ending up with
None
variables in in their program with no idea how they got there due to user mistakes, for example after neglecting to convert strings to numbers after importing from a file before using them.The error messages I've added could certainly be made a bit more specific.
e.g. before:
e.g. after: