Skip to content

stdlib: use bool for annotations where the default is False #9672

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

Merged
merged 1 commit into from
Feb 4, 2023
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
26 changes: 13 additions & 13 deletions stdlib/_codecs.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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]: ...
16 changes: 8 additions & 8 deletions stdlib/builtins.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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: ...
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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: ...

Expand Down
8 changes: 4 additions & 4 deletions stdlib/quopri.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
2 changes: 1 addition & 1 deletion stdlib/tkinter/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
Expand Down
2 changes: 1 addition & 1 deletion stdlib/uu.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...