Skip to content

bpo-45680: Clarify documentation on GenericAlias objects #29335

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

Merged
merged 30 commits into from
Jan 19, 2022
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
a6fe738
bpo-45680: Clarify documentation on ``GenericAlias`` objects
AlexWaygood Oct 30, 2021
cef0930
Correct typo
AlexWaygood Oct 30, 2021
614fce5
Add more `shelve` classes
AlexWaygood Oct 31, 2021
74269b8
Remove brackets
AlexWaygood Nov 1, 2021
671579b
Add link to container classes, remove use of the word 'they'
AlexWaygood Nov 1, 2021
d367338
Improve cross-references to data model docs
AlexWaygood Nov 2, 2021
d945e06
Move example to ``__class_getitem__`` docs in the data model
AlexWaygood Nov 2, 2021
629a29d
revert line 4813
AlexWaygood Nov 2, 2021
5dd309c
More instances where it is implied that only containers can be parame…
AlexWaygood Nov 2, 2021
5dbccad
Improve references in glossary and typing docs
AlexWaygood Nov 2, 2021
bc457dd
Fix typing docs link to ``__class_getitem__`` method
AlexWaygood Nov 2, 2021
d398971
Add note about ``typing.Generic``
AlexWaygood Nov 2, 2021
a195216
Merge branch 'generic-alias-docs' of https://github.com/AlexWaygood/c…
AlexWaygood Nov 2, 2021
af257a6
Update glossary
AlexWaygood Nov 18, 2021
eb7e7be
Update typing
AlexWaygood Nov 18, 2021
5c8fe0d
update datamodel
AlexWaygood Nov 18, 2021
010ca86
delete news
AlexWaygood Nov 18, 2021
682cd6d
Merge remote-tracking branch 'origin/main' into generic-alias-docs
AlexWaygood Nov 18, 2021
92e0463
A few tweaks
AlexWaygood Nov 19, 2021
dd3369e
Add full stop.
AlexWaygood Nov 19, 2021
6e2d8f5
Remove redundant clause.
AlexWaygood Nov 19, 2021
43f9429
Update Doc/library/stdtypes.rst
AlexWaygood Nov 19, 2021
ba2af17
Reduce diff
AlexWaygood Nov 29, 2021
2776b8d
Trailing whitespace
AlexWaygood Nov 29, 2021
f2efd8b
Update Doc/library/stdtypes.rst
AlexWaygood Dec 4, 2021
ec8a509
Fix CI
AlexWaygood Dec 4, 2021
8fad702
Improve markup readability
AlexWaygood Dec 5, 2021
e5a57e8
Steer clear of the word "subtype"
AlexWaygood Dec 5, 2021
ae21ffe
Tweak
AlexWaygood Dec 5, 2021
3944e8c
Apply formatting suggestions from code review
Fidget-Spinner Jan 19, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update Doc/library/stdtypes.rst
Clarify example with `bytes`

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
  • Loading branch information
AlexWaygood and Fidget-Spinner authored Dec 4, 2021
commit f2efd8b35b4524ac45cbb124dbde75e37c35af82
2 changes: 1 addition & 1 deletion Doc/library/stdtypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4856,7 +4856,7 @@ type and the :class:`bytes` data type:
represent this kind of object in type annotations with the ``GenericAlias``
``re.Match[str]``

* If ``y = re.search(b'bar', b'bar')``, however, ``y`` will also be an instance
* If ``y = re.search(b'bar', b'bar')``, (note the `b` for :class:`bytes`), ``y`` will also be an instance
of ``re.Match``, but the return values of ``y.group(0)`` and ``y[0]`` will
both be of type :class:`bytes`. In type annotations, we would represent this
subtype of :ref:`re.Match <match-objects>` with ``re.Match[bytes]``.
Expand Down