-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Implement delegate_names to allow decorating delegated attributes #22599
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
Conversation
Hello @jbrockmendel! Thanks for submitting the PR.
|
If you fetch and merge master the CI failures should be fixed. |
Codecov Report
@@ Coverage Diff @@
## master #22599 +/- ##
==========================================
+ Coverage 92.04% 92.04% +<.01%
==========================================
Files 169 169
Lines 50782 50785 +3
==========================================
+ Hits 46742 46745 +3
Misses 4040 4040
Continue to review full report at Codecov.
|
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.
Agreed this is nicer.
Merging on Monday if no objections.
|
||
CategoricalIndex._add_numeric_methods_add_sub_disabled() | ||
CategoricalIndex._add_numeric_methods_disabled() | ||
CategoricalIndex._add_logical_methods_disabled() | ||
CategoricalIndex._add_comparison_methods() | ||
CategoricalIndex._add_accessors() |
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.
slightly -0 here as I like the _add_*
flow. but ok
thanks @jbrockmendel |
This PR defines a
delegate_names
decorator that provides an alternative (and to my taste, much nicer) syntax for pinning delegated attributes to Accessor classes.Effectively this just moves the call to
_add_delegate_accessors
from after the class definition to a decorator on the class. I find this much harder to overlook when reading a class definition.git diff upstream/master -u -- "*.py" | flake8 --diff