While typing sed.py I ran into an issue with mypy and __rmul__ which I'm yet to resolve but it got me thinking.
All the dunder multiplication functions do is scale lnu by a number (which I have also modified to do fnu if present but that's beside the point). This is a very simplified version of multiplication overloading and IMO would be better served by a method called scale which implies the intent of the operation. The multiplication syntax is nice but somewhat hides the intention.
While typing
sed.py
I ran into an issue with mypy and__rmul__
which I'm yet to resolve but it got me thinking.All the dunder multiplication functions do is scale
lnu
by a number (which I have also modified to dofnu
if present but that's beside the point). This is a very simplified version of multiplication overloading and IMO would be better served by a method calledscale
which implies the intent of the operation. The multiplication syntax is nice but somewhat hides the intention.What does everyone think?