-
Notifications
You must be signed in to change notification settings - Fork 86
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
Add Type Annotations #463
Comments
I'm definitely open to adding these. It's just a matter of someone finding the time. |
Language support for type annotations starts at Python 3.5. Adding this directly into the codebase might not be easy to do while we are still supporting 2.7 and 3.4. I know of two alternatives:
|
Python 2 support will go away Real Soon Now but I'm not sure when we can realistically stop supporting Python 3.4. Some research is required into Linux distros etc that still ship Python 3.4. A type stub library might be the easiest place to start. |
First thing, I would love to have type-hints available! 👍
According to: https://endoflife.date/python Python 2.7 was end of life on 1-Jan-2020 (over two years ago) I think libraries should keep moving forward and people who are using end-of-life versions of Python can also use end-of-life versions of libraries. Which means it is okay to drop support for the old versions of Python moving forward, and users can always install the previous versions of imapclient in order to support their old version. |
IMAPClient no longer supports Python 2 and 3.6 is the minimum supported version so PRs which add type annotations would be very welcome now ;-) |
I'll try to get some time and start working on this in bits and pieces. But if anyone else wants to work on it feel free. My technique is to try to do multiple PRs where they add type-hints to one or two files at a time. That way it isn't so hard to review. |
That sounds like a really sensible approach. |
Note that we've just removed Python 3.7 as a support version. |
I think you meant Python 3.6 was removed. From #513 we dropped Python 3.6. But happy to also drop Python 3.7 at some point as it is also end-of-life. |
Yes sorry, I meant 3.6 |
In regards to concerns over usage of the package in older versions of python you can keep track of recent downloads via https://pypistats.org/packages/imapclient |
When using tools such as mypy or type checking in vscode, type annotations would be useful.
Missing type annotations can also lead to errors when using strict type checking.
The text was updated successfully, but these errors were encountered: