Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.1k
gh-127647: Add typing.Reader and Writer protocols#127648
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes from1 commit
Commits
Show all changes
37 commits Select commitHold shift + click to select a range
b45fec0
Add typing.Reader and Writer protocols
srittau1525e05
Add a note about Iterable
srittau7867ec1
Fix docs formatting
srittau6a22a02
Small wording improvements
srittau5d632a3
Simplify the docs/improve formatting
srittau4d50c2e
Explicitly document the methods
srittau1e1ea41
Mark protocol members as abstract
srittau56a38a0
Add .. versionadded
srittauf2c331b
Added slashes to documented signatures
srittau6764b6a
Fix overindentation
srittau022acaa
Fix documentation of Reader.__iter__()
srittaub86073d
Remove the @runtime_checkable flags
srittau65eb040
Merge branch 'main' into typing-readable-writable
srittau2b9159d
Merge branch 'main' into typing-readable-writable
srittau1f42b21
Remove Reader.__iter__() and readline()
srittau0325f5a
Move protocols to io
srittau632511a
Update whatsnew
srittau3b384f9
Update NEWS file
srittau5bdb4cc
Fix abstractmethod import
srittau35dcaf4
Fix runtime_checkable link in docs
srittau5584a57
Add Reader and Writer to proto allowlist
srittauaf81301
Import Reader and Writer into _pyio
srittau5a8b915
Import _collections_abc dynamically
srittaub1593fa
Merge branch 'main' into typing-readable-writable
srittau577b893
Use metaclass instead of deriving from `ABC`
srittaucedfa42
Use __class_getitem__ instead of making the class generic
srittaua0b9e47
Remove type annotations
srittau53a2250
Move import back to top level
srittau03aa3a2
Merge branch 'main' into typing-readable-writable
srittauca72c19
Fix doc reference to decorator
srittau3b5975e
Fix references in docs
srittau96080fe
Split signature
srittau3723370
Document that Reader and Writer are generic
srittau76003a8
Add tests
srittau43e23f0
Add missing import
srittauc644770
Doc fixes
srittaubfab2fd
Merge branch 'main' into typing-readable-writable
srittauFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
Added slashes to documented signatures
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
commitf2c331b2103f014b72bcce386383ba19e901b581
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -2825,12 +2825,12 @@ decorated with :func:`@runtime_checkable <runtime_checkable>`. | ||
.. versionadded:: next | ||
.. method:: read(size=..., /) | ||
Read data from the input stream and return it. If ``size`` is | ||
srittau marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
specified, at most ``size`` items (bytes/characters) will be read. | ||
.. method:: readline(size=..., /) | ||
Read a line of data from the input stream and return it. If ``size`` is | ||
specified, at most ``size`` items (bytes/characters) will be read. | ||
@@ -2852,7 +2852,7 @@ decorated with :func:`@runtime_checkable <runtime_checkable>`. | ||
.. versionadded:: next | ||
.. method:: write(data, /) | ||
Write data to the output stream and return number of items | ||
(bytes/characters) written. | ||
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.