8000 typing: accept buffers in typing.IO.write by JelleZijlstra · Pull Request #9084 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content

typing: accept buffers in typing.IO.write #9084

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

Closed
wants to merge 17 commits into from
Closed
Changes from 1 commit
Commits
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
type ignore
  • Loading branch information
JelleZijlstra committed Nov 4, 2022
commit e940cdfe96d02f1b0cf4486cb946553f987709e4
6 changes: 6 additions & 0 deletions stdlib/typing.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,12 @@ class IO(Iterator[AnyStr], Generic[AnyStr]):
class BinaryIO(IO[bytes]):
@abstractmethod
def __enter__(self) -> BinaryIO: ...
# False positive, see
# https://github.com/python/mypy/issues/14002
# This method can be removed when the mypy bug is fixed, it's here just
# so we don't have to type ignore every subclass of BinaryIO.
@abstractmethod
def write(self, __s: ReadableBuffer) -> int: ... # type: ignore[override]

class TextIO(IO[str]):
# See comment regarding the @properties in the `IO` class
Expand Down
0