-
Notifications
You must be signed in to change notification settings - Fork 760
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
Use existing fields and methods before calling custom __getattr__ #505
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.
LGTM, though it's desirable if we have a test
Previously, defining `__getattr__` would override all existing fields and methods. This changes it to behave like a `__getattr__` method defined in python, i.e. the custom method is only called if there isn't a field or method of that name
Codecov Report
@@ Coverage Diff @@
## master #505 +/- ##
=========================================
+ Coverage 87.52% 87.8% +0.28%
=========================================
Files 65 65
Lines 3422 3435 +13
=========================================
+ Hits 2995 3016 +21
+ Misses 427 419 -8
Continue to review full report at Codecov.
|
1 similar comment
Codecov Report
@@ Coverage Diff @@
## master #505 +/- ##
=========================================
+ Coverage 87.52% 87.8% +0.28%
=========================================
Files 65 65
Lines 3422 3435 +13
=========================================
+ Hits 2995 3016 +21
+ Misses 427 419 -8
Continue to review full report at Codecov.
|
Rebased and added a test. |
Thank for adding the test! |
Previously, defining
__getattr__
would override all existing fields and methods. This changes it to behave like a__getattr__
method defined in python, i.e. the custom method is only called if there isn't a field or method of that name.