Skip to content
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

Update asyncio.Stream.readuntil #11755

Merged
merged 4 commits into from
Apr 14, 2024
Merged

Conversation

bmerry
Copy link
Contributor

@bmerry bmerry commented Apr 14, 2024

bmerry and others added 2 commits April 14, 2024 10:30
- Make use of ReadableBuffer to generalise the arguments accepted
  (implementing the suggestion made in a comment).
- Support a tuple of separators in Python 3.13, as implemented in
  python/cpython#16429 and python/cpython#117723.

This comment has been minimized.

This comment has been minimized.

Copy link
Collaborator

@srittau srittau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, and congratulations on getting that PR merged after only short five years. :) On issue below.

# Can be any buffer that supports len(); consider changing to a Protocol if PEP 688 is accepted
async def readuntil(self, separator: bytes | bytearray | memoryview = b"\n") -> bytes: ...
if sys.version_info >= (3, 13):
async def readuntil(self, separator: _ReaduntilBuffer | tuple[_ReaduntilBuffer] = b"\n") -> bytes: ...
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
async def readuntil(self, separator: _ReaduntilBuffer | tuple[_ReaduntilBuffer] = b"\n") -> bytes: ...
async def readuntil(self, separator: _ReaduntilBuffer | tuple[_ReaduntilBuffer, ...] = b"\n") -> bytes: ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I'm always making that mistake with tuples. Fixed now.

Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@srittau srittau merged commit 9d234d9 into python:main Apr 14, 2024
55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants