-
Notifications
You must be signed in to change notification settings - Fork 997
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Monkeypatch the minus operator #1029
Comments
This is better handled in boxing all int types. @protolambda, are we safe with the new uint types everywhere? |
The new uint types are subclasses of uint. So you could override def __add__(self, other):
return self.__class__(super().__add__(other))
def __sub__(self, other):
return self.__class__(super().__sub__(other)) Current behavior is already close:
And then when you try to put the first somewhere, and the int is coerced to uint8, you get the error. You lose the type in between though, overriding the Do you want it in #1180? |
And what do we want for: |
Yay, it catched something. In old testing code though. Hope we find more with the ongoing fuzzing. |
See #1017 for context—cc @mkalinin @djrtwo
Monkeypatch the minus operator
-
so that ifa - b
is ever negative weassert False
. That will allow the executable spec to automatically reportuint64
underflows. May prove useful in the context of fuzz testing.The text was updated successfully, but these errors were encountered: