-
Notifications
You must be signed in to change notification settings - Fork 262
Implement TypeGuard (PEP 649) #803
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
Conversation
Whew I finally managed to defeat Python 3.5.2. @Fidget-Spinner would you mind reviewing this PR? |
Indeed, no f-strings are a pain I thought I'd never experience again :(.
Sure, I'll try to review it by this weekend (caught up with some other stuff right now). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I can see the parallels with Final
(I also learnt a lot about typing's older incarnations - e.g. didn't know _eval_type
was strictly compulsory in older versions).
Supporting so many versions of typing
is tricky. Thanks for handling the backport!
Thanks for the review! Now it's time to prepare a release. |
Closes pola-rs#2185. Im not 100% sure this has not been in before v4, i.e. the PR (python/typing#803) was merged May 1, and the same day 3.10.0 of the package was released. However, I dont think it hurts to push to v4?
Closes #2185. Im not 100% sure this has not been in before v4, i.e. the PR (python/typing#803) was merged May 1, and the same day 3.10.0 of the package was released. However, I dont think it hurts to push to v4?
This should be the last missing piece for a 3.10-compatible release.
The implementation was mostly inspired by that of
Final
, with an additional special case for 3.9.