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

Type Hints #1407

Open
Infirmarian opened this issue Jul 22, 2020 · 10 comments · May be fixed by #1828
Open

Type Hints #1407

Infirmarian opened this issue Jul 22, 2020 · 10 comments · May be fixed by #1828
Labels
Feature This is regarding a new feature Improvement This is regarding an improvement to an existing feature
Milestone

Comments

@Infirmarian
Copy link

Since v4.0 will be fully dropping Python 2.x support, could static type hints in accordance with PEP 484 be a part of the update? This would greatly improve integration with applications that use mypy, pyre or other static type checking, as well as IDE experiences. I'd be willing to contribute to this effort, having used tweepy previously and having experience with static type checking in Python 3

@Harmon758
Copy link
Member

This is something I'd like to do, but I'm not sure if it'll be included in v4.0.
If it's not, having it as part of v4 at some point would be reasonable.

@Harmon758 Harmon758 added Feature This is regarding a new feature Improvement This is regarding an improvement to an existing feature labels Jul 23, 2020
@Harmon758 Harmon758 added this to the 4.1 milestone May 16, 2021
seratch added a commit to seratch/tweepy that referenced this issue Jan 8, 2022
seratch added a commit to seratch/tweepy that referenced this issue Jan 8, 2022
seratch added a commit to seratch/tweepy that referenced this issue Jan 8, 2022
seratch added a commit to seratch/tweepy that referenced this issue Jan 9, 2022
@seratch
Copy link
Contributor

seratch commented Jan 24, 2022

Hi @Harmon758, if you're still interested in adding type hints to this project, could you check my pull request resolving it? #1759 Let me know if you prefer splitting the large PR into smaller ones. Thanks!

@Harmon758
Copy link
Member

@seratch Thanks for the PR. I did see it, but right now, my priority is in getting v4.5.0 out and then adding support for streaming with Twitter API v2, hopefully with v4.6.0. That's the last thing Tweepy needs to fully support Twitter API v2.

Since it's such a big addition to the library, I'll probably make a separate branch for type hints while it's in development, so it might be a good idea to split it into smaller PRs once that happens. I think I'd also like to drop support for Python 3.6 beforehand, but I'm not sure about that yet. It might be helpful if you could join the Discord server to discuss any decisions about library development.

@seratch
Copy link
Contributor

seratch commented Jan 24, 2022

@Harmon758 Thanks for the reply! I do understand your priorities. Also, I was also thinking that, in general, it's not so easy to quickly check and merge such a large pull request.

I will wait for the right timing to collaborate for the type hint addition. If I am unable to work on it at the timing (perhaps, I won't be able to continuously contribute to this project due to my own priorities), feel free to take only useful ones from the PR. That being said, if you need any help from me, please don't hesitate to ask more work.

@Harmon758
Copy link
Member

Harmon758 commented Feb 25, 2022

Support for Python 3.6 has been dropped now (#1788), allowing utilization of Postponed Evaluation of Annotations (PEP 563), Type Hinting Generics In Standard Collections (PEP 585), and the New Type Union Operator (PEP 604).

@seratch
Copy link
Contributor

seratch commented Feb 25, 2022

@Harmon758 Do you want me to resolve the conflicts in the PR now? Or, do you have a different time frame for merging he changes (say, in a few months or so)?

@Harmon758
Copy link
Member

Feel free to do so now, but I would appreciate smaller (probably per-file) PRs.
Each PR would be easier to review, and therefore likely get merged a lot faster that way.

@seratch
Copy link
Contributor

seratch commented Feb 25, 2022

@Harmon758 OK, I will close #1759 and may submit smaller ones when I have time! That being said, if you would like to merge those changes more quickly, please feel free to take my changes in your PRs.

@Harmon758 Harmon758 linked a pull request Feb 26, 2022 that will close this issue
@Harmon758
Copy link
Member

I've created a type-hints branch and draft PR #1828 for this now.

@reagle
Copy link

reagle commented Mar 14, 2023

Is this stalled?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature This is regarding a new feature Improvement This is regarding an improvement to an existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants