-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Python 2 feature freeze (and removal of support) #12237
Comments
#12202 was a pretty significant Python 2 regression and we've only gotten the one report from it :-) |
Worth noting that mypy appears to be the last type checker to still support Python 2. Pyre and pyright never supported it; pytype and pyanalyze dropped support last year. We also stopped updating the |
Is Python 2 support still important for Dropbox? |
No. |
I think that PyCharm still supports Python 2. There are also quite a few downloads of the |
I closed existing Python 2 specific issues (thanks @AlexWaygood for tagging them!). We don't need to keep open any new issues that only affect Python 2, unless it is a regression in a recent mypy release. |
I found out that there is a regression in typeshed that makes type checking Python 2 code impossible in 0.950 python/typeshed#7367 (comment) It seems that no one else has Python 2 installed, so all the relevant tests were getting skipped, including in CI. Since we effectively haven't been testing Python 2 support, I think we should just drop support in the next release. I don't think there is much to be gained from fixing this issue, and I don't really want to ask anyone who maintains typeshed to fix it :) Perhaps we can post on the blog that we are considering dropping support for Python 2 in 0.960 in a blog post prior to the release so that if anyone has a problem with it they can open an issue (or better yet comment on this one). Also to clarify: I am not worried about this specific issue, more that we aren't really checking Python 2 in CI anymore, so I think we shouldn't claim to support it. |
Does the Python 2 issue cause serious problems outside tests? I was able to type check simple Python 2 code examples without problems, at least. |
I think anything using set, mutable set or anything that inherits from AbstractSet will probably be broken. |
The Python 3 stubs apparently generate similar errors, but they are ignored. Example:
Since we don't normally report errors from typeshed stubs, the issue seems benign. I'll prepare a typeshed PR that ignores the errors in the Python 2 stubs as well. |
Suggested fix to the Python 2 issues: python/typeshed#7894 |
It is now second half of 2022 — can we drop support? I'm sure people who are happy with Python 2 will also be happy pinning to an older version of mypy; we can even have |
The second half of 2022 starts on July 1st, so we are almost -- but not quite -- there. |
It's now the second half of 2022, so we can finally drop Python 2 support. List of steps (this is probably incomplete):
|
I also propose to drop |
Won't some Python 3 code that was ported from Python 2 still have |
Yeah, I can add +1 to @ethanhs comment. There is some code that runs on Python 3, but is still being cleaned up from all the |
I think you need to add a new version to the readthedocs config now that is also pinned to an older version so that people can still easily get the needed docs when they're dealing with legacy Python 2 stuff? |
(It might also be worth adding something somewhere to the documentation about the removed support?) |
Closing, since this is done. Use of the Python 2 options with new mypy has a nice error message which should be enough documentation. Not planning on more readthedocs config for this. Python 2 is dead. I assume if people still have Python 2 codebases they have bigger problems than tweaking their mypy config. And git is always forever. If you feel strongly, open another issue and see if it gets upvotes. |
@hauntsaninja It would be really great if you could re upload the last documentation with Python 2 support on readthedocs as an additional version. Right now, it has become nearly impossible to find online useful information regarding type hints for Python 2. |
Since Python 2 reached its EOL Jan 1 2020 (over two years ago), I think that it's time to not actively improve Python 2 support any more.
Details:
cc @sobolevn who has done some recent work on Python 2 features.
The text was updated successfully, but these errors were encountered: