Adds docs for TypeGuard type, #10591#10758
Merged
hauntsaninja merged 16 commits intopython:masterfrom Aug 3, 2021
sobolevn:issue-10591
Merged
Adds docs for TypeGuard type, #10591#10758hauntsaninja merged 16 commits intopython:masterfrom sobolevn:issue-10591
hauntsaninja merged 16 commits intopython:masterfrom
sobolevn:issue-10591
Conversation
JelleZijlstra
requested changes
Jul 9, 2021
Member
JelleZijlstra
left a comment
There was a problem hiding this comment.
Thanks! I have a couple of wording suggestions.
Also, I'm not sure the "Casts" section is the right place for these docs. "More types" is the traditional place for advanced type system features. I'm curious to hear others' opinions.
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Member
Author
|
@JelleZijlstra thanks! I thought that "casts" is the closest to type guards. I can move it, no problem. |
Collaborator
|
Thank you for this! Fixed a couple small nits |
Member
Author
|
@JelleZijlstra @hauntsaninja so, should I move this to "Advanced types"? Or is "Casts" the proper place? 🙂 |
Collaborator
|
I'd probably put it in "More types" too, but don't feel strongly. |
Member
Author
|
Moved! 👍 |
Member
Author
|
@hauntsaninja @JelleZijlstra friendly ping 🙂 |
Collaborator
|
Thanks again! :-) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I am writting an article about
TypeGuards and I've noticed thatmypydoes not document howTypeGuards work.So, here it is!
It has several examples from the PEP itself and several custom ones.
I have tried to cover all corner-cases that I am aware of, but possibly there are other details that I've missed.
I would appreciate your feedback! 👍
Closes #10591