Skip to content
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

Classes should maintain a registry of accessors #19963

Closed
TomAugspurger opened this issue Mar 2, 2018 · 2 comments
Closed

Classes should maintain a registry of accessors #19963

TomAugspurger opened this issue Mar 2, 2018 · 2 comments
Labels
API Design Blocker Blocking issue or pull request for an upcoming release
Milestone

Comments

@TomAugspurger
Copy link
Contributor

Dask would like to inherit the accessors registered by register_*_acessor. This would be much easier if the regiser_*_accessor methods added the name of the accessor to a (private) class variable.

It seems like we have use of it in pandas as well: https://github.com/pandas-dev/pandas/pull/19960/files#r171815351

@TomAugspurger TomAugspurger added this to the 0.23.0 milestone Mar 2, 2018
@TomAugspurger TomAugspurger added the Blocker Blocking issue or pull request for an upcoming release label Mar 17, 2018
@WillAyd
Copy link
Member

WillAyd commented Mar 30, 2018

I could be coming way out of left field on this one but were metaclasses ever given consideration for the accessors? It seems like using them instead of decorators would still allow you to register the methods you need on a subclass, but at the same time give give you access to that registered metadata without having to store it in a private variable in the subclass

@TomAugspurger
Copy link
Contributor Author

TomAugspurger commented Mar 30, 2018 via email

@jreback jreback modified the milestones: 0.23.0, Next Major Release Apr 14, 2018
TomAugspurger added a commit to TomAugspurger/pandas that referenced this issue Apr 21, 2018
Re-using the _accessors attribute, since nothing seemed to rely on it
being a frozenset.

Closes pandas-dev#19963
@jreback jreback modified the milestones: Next Major Release, 0.23.0 Apr 21, 2018
TomAugspurger added a commit that referenced this issue Apr 23, 2018
Re-using the _accessors attribute, since nothing seemed to rely on it
being a frozenset.

Closes #19963
jason-ytsao pushed a commit to jason-ytsao/exp_vtb that referenced this issue Aug 10, 2022
Re-using the _accessors attribute, since nothing seemed to rely on it
being a frozenset.

Closes pandas-dev/pandas#19963
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Design Blocker Blocking issue or pull request for an upcoming release
Projects
None yet
Development

No branches or pull requests

3 participants