gh-105578: Add more usage examples to typing.AnyStr docs#107045
Merged
AlexWaygood merged 5 commits intopython:mainfrom Jul 31, 2023
Merged
gh-105578: Add more usage examples to typing.AnyStr docs#107045AlexWaygood merged 5 commits intopython:mainfrom
typing.AnyStr docs#107045AlexWaygood merged 5 commits intopython:mainfrom
Conversation
AlexWaygood
reviewed
Jul 22, 2023
Member
AlexWaygood
left a comment
There was a problem hiding this comment.
Thank you! Could you also add a note somewhere along the lines of:
Note that, despite its name,
AnyStrhas nothing to do with theAnytype, nor does it mean "any string"
?
AlexWaygood
reviewed
Jul 23, 2023
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
AlexWaygood
reviewed
Jul 26, 2023
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
typing.AnyStrtyping.AnyStr docs
Contributor
|
Thanks @michael-the1 for the PR, and @AlexWaygood for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12. |
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Jul 31, 2023
…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 <michael-the1@users.noreply.github.com>
|
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. |
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Jul 31, 2023
…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 <michael-the1@users.noreply.github.com>
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.
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/