-
-
Notifications
You must be signed in to change notification settings - Fork 31.2k
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
gh-105578: Add more usage examples to typing.AnyStr
docs
#107045
Conversation
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.
Thank you! Could you also add a note somewhere along the lines of:
Note that, despite its name,
AnyStr
has nothing to do with theAny
type, nor does it mean "any string"
?
Co-authored-by: Alex Waygood <[email protected]>
Co-authored-by: Alex Waygood <[email protected]>
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.
Thank you, looks great!
typing.AnyStr
typing.AnyStr
docs
Thanks @michael-the1 for the PR, and @AlexWaygood for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12. |
…honGH-107045) ``typing.AnyStr`` has different semantics to ``str | bytes``, which often leads to user confusion (cherry picked from commit f877b32) Co-authored-by: Michael The <[email protected]>
GH-107503 is a backport of this pull request to the 3.12 branch. |
GH-107504 is a backport of this pull request to the 3.11 branch. |
…honGH-107045) ``typing.AnyStr`` has different semantics to ``str | bytes``, which often leads to user confusion (cherry picked from commit f877b32) Co-authored-by: Michael The <[email protected]>
Add more usage examples to
typing.AnyStr
.In particular, contrast it with
str | bytes
, with examples of where one or the other would be used.typing.AnyStr
#105578📚 Documentation preview 📚: https://cpython-previews--107045.org.readthedocs.build/