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

TYP: @final in groupby #38200

Merged
merged 8 commits into from
Dec 5, 2020
Merged

TYP: @final in groupby #38200

merged 8 commits into from
Dec 5, 2020

Conversation

jbrockmendel
Copy link
Member

No description provided.

@jreback jreback added Groupby Typing type annotations, mypy/pyright type checking labels Dec 2, 2020
@jreback
Copy link
Contributor

jreback commented Dec 2, 2020

cc @simonjayhawkins

@simonjayhawkins
Copy link
Member

Thanks @jbrockmendel no harm I guess if final is used where the method is not overridden or a class subclassed, but I think the intention of @final is to prevent overridding/subclassing. If this many finals are needed, is there something wrong with our class design? If this is kept to non-public code there is not an issue, since we can always remove the @final as needed, but we need to be careful when this is used on any subclasses of public classes.

@jbrockmendel
Copy link
Member Author

but I think the intention of @Final is to prevent overridding/subclassing. If this many finals are needed, is there something wrong with our class design

In these cases I'm using it largely to indicate to the reader that a the method is not overridden, which can be a hassle to check manually bc there are a bunch of similarly-named class hierarchies (each one is individually reasonable) and a bunch of similarly-named methods.

@simonjayhawkins
Copy link
Member

yes, I can see how that helps.

users that subclass, override methods and type check may get errors though. Only time will tell whether this will be an real issue for us to consider.

@jreback
Copy link
Contributor

jreback commented Dec 4, 2020

ok if you can rebase

@jbrockmendel
Copy link
Member Author

rebased+green

@jreback jreback added this to the 1.2 milestone Dec 5, 2020
@jreback jreback merged commit 7073ee1 into pandas-dev:master Dec 5, 2020
@jbrockmendel jbrockmendel deleted the typ-gb-final branch December 5, 2020 02:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Groupby Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants