-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Contract event overloading breaks hasattr
#1560
Comments
👍 to making |
@pipermerriam Are we looking to change |
@swixx sorry I missed your comment when it came through. I believe we want to change |
cc @kclowes I there is an argument to be made that this qualifies as a breaking change but also a bugfix. Anyone with existing code catching these exception would end up with broken code. We could:
If option 2 proves viable which I don't see why it wouldn't I think it's preferrable but I'm curious what you think. |
Yeah, I'd lean toward option 2. I find it really frustrating when a library implements a breaking change on a minor or patch release, unless it definitely is a bug. And I'd argue that this is a functionality change, not a bug. We can add the removal of the interim exception class to the v6 tracking issue here. |
@swixx chime in if you'd like to take this on (or just open a PR 😄 ) |
What was wrong?
Calling
hasattr
on a contract events object should returnTrue
orFalse
as appropriate. Instead, it raises the following exception:How can it be fixed?
Fix the 'helpful' overloading of
__getattr__
to raise the exception expected by Python (preferable), or implement__hasattr__
.The text was updated successfully, but these errors were encountered: