-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Classes should maintain a registry of accessors #19963
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
Labels
Milestone
Comments
This was referenced Mar 2, 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 |
I think storing the registry as a private var on the class having the
accessor attached strikes a nice balance between simplicity and usability.
…On Fri, Mar 30, 2018 at 3:38 AM, William Ayd ***@***.***> wrote:
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
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#19963 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABQHIn4bGrzqU4MGI46_4JFNpsAN2Fb1ks5tje78gaJpZM4SZ0nm>
.
|
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
Merged
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
Dask would like to inherit the accessors registered by
register_*_acessor
. This would be much easier if theregiser_*_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
The text was updated successfully, but these errors were encountered: