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

Use Literal type in io and _compression #6917

Merged
merged 3 commits into from
Jan 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions stdlib/_compression.pyi
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from _typeshed import WriteableBuffer
from io import BufferedIOBase, RawIOBase
from io import DEFAULT_BUFFER_SIZE, BufferedIOBase, RawIOBase
from typing import Any, Callable, Protocol

BUFFER_SIZE: Any
BUFFER_SIZE = DEFAULT_BUFFER_SIZE

class _Reader(Protocol):
def read(self, __n: int) -> bytes: ...
Expand Down
9 changes: 5 additions & 4 deletions stdlib/io.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ from _typeshed import ReadableBuffer, Self, StrOrBytesPath, WriteableBuffer
from os import _Opener
from types import TracebackType
from typing import IO, Any, BinaryIO, Callable, Iterable, Iterator, TextIO
from typing_extensions import Literal

DEFAULT_BUFFER_SIZE: int
DEFAULT_BUFFER_SIZE: Literal[8192]

SEEK_SET: int
SEEK_CUR: int
SEEK_END: int
SEEK_SET: Literal[0]
SEEK_CUR: Literal[1]
SEEK_END: Literal[2]

open = builtins.open

Expand Down