mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 13:34:58 +08:00
stdlib: use bool for annotations where the default is False (#9672)
This commit is contained in:
@@ -104,35 +104,35 @@ if sys.version_info < (3, 8):
|
||||
def unicode_internal_decode(__obj: str | ReadableBuffer, __errors: str | None = None) -> tuple[str, int]: ...
|
||||
def unicode_internal_encode(__obj: str | ReadableBuffer, __errors: str | None = None) -> tuple[bytes, int]: ...
|
||||
|
||||
def utf_16_be_decode(__data: ReadableBuffer, __errors: str | None = None, __final: int = False) -> tuple[str, int]: ...
|
||||
def utf_16_be_decode(__data: ReadableBuffer, __errors: str | None = None, __final: bool = False) -> tuple[str, int]: ...
|
||||
def utf_16_be_encode(__str: str, __errors: str | None = None) -> tuple[bytes, int]: ...
|
||||
def utf_16_decode(__data: ReadableBuffer, __errors: str | None = None, __final: int = False) -> tuple[str, int]: ...
|
||||
def utf_16_decode(__data: ReadableBuffer, __errors: str | None = None, __final: bool = False) -> tuple[str, int]: ...
|
||||
def utf_16_encode(__str: str, __errors: str | None = None, __byteorder: int = 0) -> tuple[bytes, int]: ...
|
||||
def utf_16_ex_decode(
|
||||
__data: ReadableBuffer, __errors: str | None = None, __byteorder: int = 0, __final: int = False
|
||||
__data: ReadableBuffer, __errors: str | None = None, __byteorder: int = 0, __final: bool = False
|
||||
) -> tuple[str, int, int]: ...
|
||||
def utf_16_le_decode(__data: ReadableBuffer, __errors: str | None = None, __final: int = False) -> tuple[str, int]: ...
|
||||
def utf_16_le_decode(__data: ReadableBuffer, __errors: str | None = None, __final: bool = False) -> tuple[str, int]: ...
|
||||
def utf_16_le_encode(__str: str, __errors: str | None = None) -> tuple[bytes, int]: ...
|
||||
def utf_32_be_decode(__data: ReadableBuffer, __errors: str | None = None, __final: int = False) -> tuple[str, int]: ...
|
||||
def utf_32_be_decode(__data: ReadableBuffer, __errors: str | None = None, __final: bool = False) -> tuple[str, int]: ...
|
||||
def utf_32_be_encode(__str: str, __errors: str | None = None) -> tuple[bytes, int]: ...
|
||||
def utf_32_decode(__data: ReadableBuffer, __errors: str | None = None, __final: int = False) -> tuple[str, int]: ...
|
||||
def utf_32_decode(__data: ReadableBuffer, __errors: str | None = None, __final: bool = False) -> tuple[str, int]: ...
|
||||
def utf_32_encode(__str: str, __errors: str | None = None, __byteorder: int = 0) -> tuple[bytes, int]: ...
|
||||
def utf_32_ex_decode(
|
||||
__data: ReadableBuffer, __errors: str | None = None, __byteorder: int = 0, __final: int = False
|
||||
__data: ReadableBuffer, __errors: str | None = None, __byteorder: int = 0, __final: bool = False
|
||||
) -> tuple[str, int, int]: ...
|
||||
def utf_32_le_decode(__data: ReadableBuffer, __errors: str | None = None, __final: int = False) -> tuple[str, int]: ...
|
||||
def utf_32_le_decode(__data: ReadableBuffer, __errors: str | None = None, __final: bool = False) -> tuple[str, int]: ...
|
||||
def utf_32_le_encode(__str: str, __errors: str | None = None) -> tuple[bytes, int]: ...
|
||||
def utf_7_decode(__data: ReadableBuffer, __errors: str | None = None, __final: int = False) -> tuple[str, int]: ...
|
||||
def utf_7_decode(__data: ReadableBuffer, __errors: str | None = None, __final: bool = False) -> tuple[str, int]: ...
|
||||
def utf_7_encode(__str: str, __errors: str | None = None) -> tuple[bytes, int]: ...
|
||||
def utf_8_decode(__data: ReadableBuffer, __errors: str | None = None, __final: int = False) -> tuple[str, int]: ...
|
||||
def utf_8_decode(__data: ReadableBuffer, __errors: str | None = None, __final: bool = False) -> tuple[str, int]: ...
|
||||
def utf_8_encode(__str: str, __errors: str | None = None) -> tuple[bytes, int]: ...
|
||||
|
||||
if sys.platform == "win32":
|
||||
def mbcs_decode(__data: ReadableBuffer, __errors: str | None = None, __final: int = False) -> tuple[str, int]: ...
|
||||
def mbcs_decode(__data: ReadableBuffer, __errors: str | None = None, __final: bool = False) -> tuple[str, int]: ...
|
||||
def mbcs_encode(__str: str, __errors: str | None = None) -> tuple[bytes, int]: ...
|
||||
def code_page_decode(
|
||||
__codepage: int, __data: ReadableBuffer, __errors: str | None = None, __final: int = False
|
||||
__codepage: int, __data: ReadableBuffer, __errors: str | None = None, __final: bool = False
|
||||
) -> tuple[str, int]: ...
|
||||
def code_page_encode(__code_page: int, __str: str, __errors: str | None = None) -> tuple[bytes, int]: ...
|
||||
def oem_decode(__data: ReadableBuffer, __errors: str | None = None, __final: int = False) -> tuple[str, int]: ...
|
||||
def oem_decode(__data: ReadableBuffer, __errors: str | None = None, __final: bool = False) -> tuple[str, int]: ...
|
||||
def oem_encode(__str: str, __errors: str | None = None) -> tuple[bytes, int]: ...
|
||||
|
||||
@@ -1235,7 +1235,7 @@ if sys.version_info >= (3, 8):
|
||||
filename: str | ReadableBuffer | _PathLike[Any],
|
||||
mode: str,
|
||||
flags: Literal[0],
|
||||
dont_inherit: int = False,
|
||||
dont_inherit: bool = False,
|
||||
optimize: int = -1,
|
||||
*,
|
||||
_feature_version: int = -1,
|
||||
@@ -1246,7 +1246,7 @@ if sys.version_info >= (3, 8):
|
||||
filename: str | ReadableBuffer | _PathLike[Any],
|
||||
mode: str,
|
||||
*,
|
||||
dont_inherit: int = False,
|
||||
dont_inherit: bool = False,
|
||||
optimize: int = -1,
|
||||
_feature_version: int = -1,
|
||||
) -> CodeType: ...
|
||||
@@ -1256,7 +1256,7 @@ if sys.version_info >= (3, 8):
|
||||
filename: str | ReadableBuffer | _PathLike[Any],
|
||||
mode: str,
|
||||
flags: Literal[1024],
|
||||
dont_inherit: int = False,
|
||||
dont_inherit: bool = False,
|
||||
optimize: int = -1,
|
||||
*,
|
||||
_feature_version: int = -1,
|
||||
@@ -1267,7 +1267,7 @@ if sys.version_info >= (3, 8):
|
||||
filename: str | ReadableBuffer | _PathLike[Any],
|
||||
mode: str,
|
||||
flags: int,
|
||||
dont_inherit: int = False,
|
||||
dont_inherit: bool = False,
|
||||
optimize: int = -1,
|
||||
*,
|
||||
_feature_version: int = -1,
|
||||
@@ -1280,7 +1280,7 @@ else:
|
||||
filename: str | ReadableBuffer | _PathLike[Any],
|
||||
mode: str,
|
||||
flags: Literal[0],
|
||||
dont_inherit: int = False,
|
||||
dont_inherit: bool = False,
|
||||
optimize: int = -1,
|
||||
) -> CodeType: ...
|
||||
@overload
|
||||
@@ -1289,7 +1289,7 @@ else:
|
||||
filename: str | ReadableBuffer | _PathLike[Any],
|
||||
mode: str,
|
||||
*,
|
||||
dont_inherit: int = False,
|
||||
dont_inherit: bool = False,
|
||||
optimize: int = -1,
|
||||
) -> CodeType: ...
|
||||
@overload
|
||||
@@ -1298,7 +1298,7 @@ else:
|
||||
filename: str | ReadableBuffer | _PathLike[Any],
|
||||
mode: str,
|
||||
flags: Literal[1024],
|
||||
dont_inherit: int = False,
|
||||
dont_inherit: bool = False,
|
||||
optimize: int = -1,
|
||||
) -> _ast.AST: ...
|
||||
@overload
|
||||
@@ -1307,7 +1307,7 @@ else:
|
||||
filename: str | ReadableBuffer | _PathLike[Any],
|
||||
mode: str,
|
||||
flags: int,
|
||||
dont_inherit: int = False,
|
||||
dont_inherit: bool = False,
|
||||
optimize: int = -1,
|
||||
) -> Any: ...
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ __all__ = ["encode", "decode", "encodestring", "decodestring"]
|
||||
|
||||
class _Input(SupportsRead[bytes], SupportsNoArgReadline[bytes], Protocol): ...
|
||||
|
||||
def encode(input: _Input, output: SupportsWrite[bytes], quotetabs: int, header: int = False) -> None: ...
|
||||
def encodestring(s: ReadableBuffer, quotetabs: int = False, header: int = False) -> bytes: ...
|
||||
def decode(input: _Input, output: SupportsWrite[bytes], header: int = False) -> None: ...
|
||||
def decodestring(s: str | ReadableBuffer, header: int = False) -> bytes: ...
|
||||
def encode(input: _Input, output: SupportsWrite[bytes], quotetabs: int, header: bool = False) -> None: ...
|
||||
def encodestring(s: ReadableBuffer, quotetabs: bool = False, header: bool = False) -> bytes: ...
|
||||
def decode(input: _Input, output: SupportsWrite[bytes], header: bool = False) -> None: ...
|
||||
def decodestring(s: str | ReadableBuffer, header: bool = False) -> bytes: ...
|
||||
|
||||
@@ -421,7 +421,7 @@ class Misc:
|
||||
def winfo_viewable(self) -> bool: ...
|
||||
def winfo_visual(self) -> str: ...
|
||||
def winfo_visualid(self) -> str: ...
|
||||
def winfo_visualsavailable(self, includeids: int = False) -> list[tuple[str, int]]: ...
|
||||
def winfo_visualsavailable(self, includeids: bool = False) -> list[tuple[str, int]]: ...
|
||||
def winfo_vrootheight(self) -> int: ...
|
||||
def winfo_vrootwidth(self) -> int: ...
|
||||
def winfo_vrootx(self) -> int: ...
|
||||
|
||||
@@ -10,4 +10,4 @@ class Error(Exception): ...
|
||||
def encode(
|
||||
in_file: _File, out_file: _File, name: str | None = None, mode: int | None = None, *, backtick: bool = False
|
||||
) -> None: ...
|
||||
def decode(in_file: _File, out_file: _File | None = None, mode: int | None = None, quiet: int = False) -> None: ...
|
||||
def decode(in_file: _File, out_file: _File | None = None, mode: int | None = None, quiet: bool = False) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user