-
Notifications
You must be signed in to change notification settings - Fork 51
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
Cursing dunder methods fails with: KeyError: '<method_to_curse>' #61
Comments
Also, other issues with the same format (cursing |
|
and my pull request will register a lot more |
Another proof that cursing dunder methods fails. I was trying to make numeric types callable, to implement implicit multiplication as it's known in some programming languages such as Julia. from forbiddenfruit import curse, reverse
def __call__(self, other, /):
return self * other
for cls in (int, float, complex):
curse(cls, "__call__", __call__)
print(2(6)) This of course gave a SyntaxWarning that |
fails with:
...
Also other dunder methods fails. e.g.:
The text was updated successfully, but these errors were encountered: