Skip to content

Implement TypeGuard (PEP 649)#803

Merged
JelleZijlstra merged 9 commits intopython:masterfrom
JelleZijlstra:typeguard
May 1, 2021
Merged

Implement TypeGuard (PEP 649)#803
JelleZijlstra merged 9 commits intopython:masterfrom
JelleZijlstra:typeguard

Conversation

@JelleZijlstra
Copy link
Member

@JelleZijlstra JelleZijlstra commented Apr 29, 2021

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.

@JelleZijlstra
Copy link
Member Author

Whew I finally managed to defeat Python 3.5.2. @Fidget-Spinner would you mind reviewing this PR?

@Fidget-Spinner
Copy link
Member

Fidget-Spinner commented Apr 29, 2021

Whew I finally managed to defeat Python 3.5.2.

Indeed, no f-strings are a pain I thought I'd never experience again :(.

@Fidget-Spinner would you mind reviewing this PR?

Sure, I'll try to review it by this weekend (caught up with some other stuff right now).

Copy link
Member

@Fidget-Spinner Fidget-Spinner left a 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!

@JelleZijlstra JelleZijlstra merged commit c33fe16 into python:master May 1, 2021
@JelleZijlstra JelleZijlstra deleted the typeguard branch May 1, 2021 00:40
@JelleZijlstra
Copy link
Member Author

Thanks for the review! Now it's time to prepare a release.

zundertj added a commit to zundertj/polars that referenced this pull request Dec 27, 2021
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?
ritchie46 pushed a commit to pola-rs/polars that referenced this pull request Dec 28, 2021
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?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants