-
Notifications
You must be signed in to change notification settings - Fork 78
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
Fix infinite recursion #258
Fix infinite recursion #258
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Can you add a small unittest?
Most of this PR addresses a problem with python2 which led all tests on my end fail. I added a small test which tests the correct behavior in the case of attrs classes which inherit from each other, which is also fixed in this PR. |
I fixed this error:
Newer versions of attrs (including the one I use) no longer have this restriction. python-attrs/attrs#559 |
Thanks @markusschmaus, great work! This looks good to me. With this change we can publish this in the next minor release and drop Python 2 in the next major release. I noticed a leftover docstring so you can remove it. BTW, do you want to clean this branch yourself or should I squash merge? |
Squash merge sounds great to me |
965f508
into
textX:igord/postponed-userobj-init-replace-methods
Fix infinite recursion on inheriting user-classes + Python 2 support
Code review checklist
CHANGELOG.md
, no needto update for typo fixes and such).
(Inception PR)
This fixes the infinite recursion we are getting when trying to call super suing type(obj). By defining the replacement methods inside a method each replacement is bound to the original class without needing to look it up.