Use Final for undocumented constants (#12450)

This commit is contained in:
Max Muoto
2024-07-28 05:02:06 -05:00
committed by GitHub
parent 1f4d0a815f
commit 9a77f6006d
10 changed files with 60 additions and 61 deletions

View File

@@ -3,7 +3,7 @@ import sys
import zlib
from _typeshed import ReadableBuffer, SizedBuffer, StrOrBytesPath
from io import FileIO
from typing import Literal, Protocol, TextIO, overload
from typing import Final, Literal, Protocol, TextIO, overload
from typing_extensions import TypeAlias
__all__ = ["BadGzipFile", "GzipFile", "open", "compress", "decompress"]
@@ -12,14 +12,14 @@ _ReadBinaryMode: TypeAlias = Literal["r", "rb"]
_WriteBinaryMode: TypeAlias = Literal["a", "ab", "w", "wb", "x", "xb"]
_OpenTextMode: TypeAlias = Literal["rt", "at", "wt", "xt"]
READ: object # undocumented
WRITE: object # undocumented
READ: Final[object] # undocumented
WRITE: Final[object] # undocumented
FTEXT: int # actually Literal[1] # undocumented
FHCRC: int # actually Literal[2] # undocumented
FEXTRA: int # actually Literal[4] # undocumented
FNAME: int # actually Literal[8] # undocumented
FCOMMENT: int # actually Literal[16] # undocumented
FTEXT: Final[int] # actually Literal[1] # undocumented
FHCRC: Final[int] # actually Literal[2] # undocumented
FEXTRA: Final[int] # actually Literal[4] # undocumented
FNAME: Final[int] # actually Literal[8] # undocumented
FCOMMENT: Final[int] # actually Literal[16] # undocumented
class _ReadableFileobj(Protocol):
def read(self, n: int, /) -> bytes: ...