Skip to content

Add Type and Final pandas._typing #26175

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

Closed
vaibhavhrt opened this issue Apr 21, 2019 · 11 comments
Closed

Add Type and Final pandas._typing #26175

vaibhavhrt opened this issue Apr 21, 2019 · 11 comments
Labels
Typing type annotations, mypy/pyright type checking

Comments

@vaibhavhrt
Copy link
Contributor

vaibhavhrt commented Apr 21, 2019

Since we are not merging #25975 Type and Final needs to be added to pandas._typing module.

Final is required for PR #25961
Type is required to stay compatible with python 3.5.1 as Type was added in 3.5.2 python docs

@vaibhavhrt
Copy link
Contributor Author

vaibhavhrt commented Apr 21, 2019

PR on the way...

@vaibhavhrt
Copy link
Contributor Author

On second thought it looks too complicated and time consuming for me. Someone else please pick it up. @TomAugspurger maybe you would be interested in it.

@jreback
Copy link
Contributor

jreback commented Apr 21, 2019

you can pretty much just directly vendor typing_extensions

@vaibhavhrt
Copy link
Contributor Author

@jreback I think you mean copy paste the relevant parts from the source code of typing_extensions. I took a look at their source code but it's a bit complicated for me. I will take a look at it again after a few days when I get some time and see what I can do.

@TomAugspurger
Copy link
Contributor

What benefit do we get from adding Final to these annotations?

@WillAyd
Copy link
Member

WillAyd commented Apr 22, 2019

Final would just indicate that a variable is not supposed to be subsequently modified.

FWIW I consider it to be a nice to have but not a blocker in the PR where it is mentioned. If we consider bumping min Python version to 3.5.2 then alternately we don’t need to vendor anything

@gfyoung
Copy link
Member

gfyoung commented Apr 23, 2019

My preference is to vendor for now. Bumping min Python version, not matter how small, is still a relatively big change to codebase.

@gfyoung gfyoung added the Typing type annotations, mypy/pyright type checking label Apr 23, 2019
@TomAugspurger
Copy link
Contributor

TomAugspurger commented Apr 23, 2019 via email

@WillAyd
Copy link
Member

WillAyd commented Apr 23, 2019

My preference is to just not add these annotations.

Final is fine to ignore. I think Type[] is very useful though and that didn't appear until 3.5.2 along with a few (less critical IMO) items:

https://docs.python.org/3.5/whatsnew/changelog.html#id28

My preference is to vendor for now. Bumping min Python version, not matter how small, is still a relative big change to codebase.

Have we bumped bug fix releases in the past? We are already dropping Py27 this release so wondering if moving to 3.5.2 from there is adding incremental risk

@gfyoung
Copy link
Member

gfyoung commented Apr 23, 2019

I don't recall if we have done incremental bumps like this in the past, but if there is interest, I think that should discussion should be handled separately in another issue / PR.

@WillAyd
Copy link
Member

WillAyd commented Apr 24, 2019

Closing this as is. Can discuss move to 3.5.2 in another issue

@WillAyd WillAyd closed this as completed Apr 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

No branches or pull requests

5 participants