Skip to content
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
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ ignore = [
"PLR5501", # Use `elif` instead of `else` then `if`, to reduce indentation
# Often just leads to redundant more verbose code when needing an actual str
"PTH208", # Use `pathlib.Path.iterdir()` instead.
"RUF036", # `None` is not at the end of the union
# Allow FIXME
"TD001", # Invalid TODO tag: `{tag}`
# Git blame is sufficient
Expand Down
2 changes: 1 addition & 1 deletion stdlib/_interpreters.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def get_config(id: SupportsIndex, *, restrict: bool = False) -> types.SimpleName
def whence(id: SupportsIndex) -> _Whence: ...
def exec(
id: SupportsIndex, code: str | types.CodeType | Callable[[], object], shared: _SharedDict = {}, *, restrict: bool = False
) -> None | types.SimpleNamespace: ...
) -> types.SimpleNamespace | None: ...
def call(
id: SupportsIndex,
callable: Callable[..., _R],
Expand Down
2 changes: 1 addition & 1 deletion stdlib/_ssl.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class _SSLContext:
post_handshake_auth: bool
protocol: int
security_level: int
sni_callback: Callable[[SSLObject, str, SSLContext], None | int] | None
sni_callback: Callable[[SSLObject, str, SSLContext], int | None] | None
verify_flags: int
verify_mode: int
def __new__(cls, protocol: int, /) -> Self: ...
Expand Down
56 changes: 28 additions & 28 deletions stdlib/ast.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1107,7 +1107,7 @@ if sys.version_info >= (3, 14):
**kwargs: Unpack[_Attributes],
) -> Self: ...

_ConstantValue: typing_extensions.TypeAlias = str | bytes | bool | int | float | complex | None | EllipsisType
_ConstantValue: typing_extensions.TypeAlias = str | bytes | bool | int | float | complex | EllipsisType | None

class Constant(expr):
__match_args__ = ("value", "kind")
Expand Down Expand Up @@ -1741,7 +1741,7 @@ if sys.version_info >= (3, 15):
mode: Literal["exec", "eval", "func_type", "single"] = "exec",
*,
type_comments: bool = False,
feature_version: None | int | tuple[int, int] = None,
feature_version: int | tuple[int, int] | None = None,
optimize: Literal[-1, 0, 1, 2] = -1,
module: str | None = None,
) -> _T: ...
Expand All @@ -1752,7 +1752,7 @@ if sys.version_info >= (3, 15):
mode: Literal["exec"] = "exec",
*,
type_comments: bool = False,
feature_version: None | int | tuple[int, int] = None,
feature_version: int | tuple[int, int] | None = None,
optimize: Literal[-1, 0, 1, 2] = -1,
module: str | None = None,
) -> Module: ...
Expand All @@ -1763,7 +1763,7 @@ if sys.version_info >= (3, 15):
mode: Literal["eval"],
*,
type_comments: bool = False,
feature_version: None | int | tuple[int, int] = None,
feature_version: int | tuple[int, int] | None = None,
optimize: Literal[-1, 0, 1, 2] = -1,
module: str | None = None,
) -> Expression: ...
Expand All @@ -1774,7 +1774,7 @@ if sys.version_info >= (3, 15):
mode: Literal["func_type"],
*,
type_comments: bool = False,
feature_version: None | int | tuple[int, int] = None,
feature_version: int | tuple[int, int] | None = None,
optimize: Literal[-1, 0, 1, 2] = -1,
module: str | None = None,
) -> FunctionType: ...
Expand All @@ -1785,7 +1785,7 @@ if sys.version_info >= (3, 15):
mode: Literal["single"],
*,
type_comments: bool = False,
feature_version: None | int | tuple[int, int] = None,
feature_version: int | tuple[int, int] | None = None,
optimize: Literal[-1, 0, 1, 2] = -1,
module: str | None = None,
) -> Interactive: ...
Expand All @@ -1795,7 +1795,7 @@ if sys.version_info >= (3, 15):
*,
mode: Literal["eval"],
type_comments: bool = False,
feature_version: None | int | tuple[int, int] = None,
feature_version: int | tuple[int, int] | None = None,
optimize: Literal[-1, 0, 1, 2] = -1,
module: str | None = None,
) -> Expression: ...
Expand All @@ -1805,7 +1805,7 @@ if sys.version_info >= (3, 15):
*,
mode: Literal["func_type"],
type_comments: bool = False,
feature_version: None | int | tuple[int, int] = None,
feature_version: int | tuple[int, int] | None = None,
optimize: Literal[-1, 0, 1, 2] = -1,
module: str | None = None,
) -> FunctionType: ...
Expand All @@ -1815,7 +1815,7 @@ if sys.version_info >= (3, 15):
*,
mode: Literal["single"],
type_comments: bool = False,
feature_version: None | int | tuple[int, int] = None,
feature_version: int | tuple[int, int] | None = None,
optimize: Literal[-1, 0, 1, 2] = -1,
module: str | None = None,
) -> Interactive: ...
Expand All @@ -1826,7 +1826,7 @@ if sys.version_info >= (3, 15):
mode: str = "exec",
*,
type_comments: bool = False,
feature_version: None | int | tuple[int, int] = None,
feature_version: int | tuple[int, int] | None = None,
optimize: Literal[-1, 0, 1, 2] = -1,
module: str | None = None,
) -> mod: ...
Expand All @@ -1838,7 +1838,7 @@ elif sys.version_info >= (3, 13):
mode: Literal["exec", "eval", "func_type", "single"] = "exec",
*,
type_comments: bool = False,
feature_version: None | int | tuple[int, int] = None,
feature_version: int | tuple[int, int] | None = None,
optimize: Literal[-1, 0, 1, 2] = -1,
) -> _T: ...
@overload
Expand All @@ -1848,7 +1848,7 @@ elif sys.version_info >= (3, 13):
mode: Literal["exec"] = "exec",
*,
type_comments: bool = False,
feature_version: None | int | tuple[int, int] = None,
feature_version: int | tuple[int, int] | None = None,
optimize: Literal[-1, 0, 1, 2] = -1,
) -> Module: ...
@overload
Expand All @@ -1858,7 +1858,7 @@ elif sys.version_info >= (3, 13):
mode: Literal["eval"],
*,
type_comments: bool = False,
feature_version: None | int | tuple[int, int] = None,
feature_version: int | tuple[int, int] | None = None,
optimize: Literal[-1, 0, 1, 2] = -1,
) -> Expression: ...
@overload
Expand All @@ -1868,7 +1868,7 @@ elif sys.version_info >= (3, 13):
mode: Literal["func_type"],
*,
type_comments: bool = False,
feature_version: None | int | tuple[int, int] = None,
feature_version: int | tuple[int, int] | None = None,
optimize: Literal[-1, 0, 1, 2] = -1,
) -> FunctionType: ...
@overload
Expand All @@ -1878,7 +1878,7 @@ elif sys.version_info >= (3, 13):
mode: Literal["single"],
*,
type_comments: bool = False,
feature_version: None | int | tuple[int, int] = None,
feature_version: int | tuple[int, int] | None = None,
optimize: Literal[-1, 0, 1, 2] = -1,
) -> Interactive: ...
@overload
Expand All @@ -1887,7 +1887,7 @@ elif sys.version_info >= (3, 13):
*,
mode: Literal["eval"],
type_comments: bool = False,
feature_version: None | int | tuple[int, int] = None,
feature_version: int | tuple[int, int] | None = None,
optimize: Literal[-1, 0, 1, 2] = -1,
) -> Expression: ...
@overload
Expand All @@ -1896,7 +1896,7 @@ elif sys.version_info >= (3, 13):
*,
mode: Literal["func_type"],
type_comments: bool = False,
feature_version: None | int | tuple[int, int] = None,
feature_version: int | tuple[int, int] | None = None,
optimize: Literal[-1, 0, 1, 2] = -1,
) -> FunctionType: ...
@overload
Expand All @@ -1905,7 +1905,7 @@ elif sys.version_info >= (3, 13):
*,
mode: Literal["single"],
type_comments: bool = False,
feature_version: None | int | tuple[int, int] = None,
feature_version: int | tuple[int, int] | None = None,
optimize: Literal[-1, 0, 1, 2] = -1,
) -> Interactive: ...
@overload
Expand All @@ -1915,7 +1915,7 @@ elif sys.version_info >= (3, 13):
mode: str = "exec",
*,
type_comments: bool = False,
feature_version: None | int | tuple[int, int] = None,
feature_version: int | tuple[int, int] | None = None,
optimize: Literal[-1, 0, 1, 2] = -1,
) -> mod: ...
else:
Expand All @@ -1926,7 +1926,7 @@ else:
mode: Literal["exec", "eval", "func_type", "single"] = "exec",
*,
type_comments: bool = False,
feature_version: None | int | tuple[int, int] = None,
feature_version: int | tuple[int, int] | None = None,
) -> _T: ...
@overload
def parse(
Expand All @@ -1935,7 +1935,7 @@ else:
mode: Literal["exec"] = "exec",
*,
type_comments: bool = False,
feature_version: None | int | tuple[int, int] = None,
feature_version: int | tuple[int, int] | None = None,
) -> Module: ...
@overload
def parse(
Expand All @@ -1944,7 +1944,7 @@ else:
mode: Literal["eval"],
*,
type_comments: bool = False,
feature_version: None | int | tuple[int, int] = None,
feature_version: int | tuple[int, int] | None = None,
) -> Expression: ...
@overload
def parse(
Expand All @@ -1953,7 +1953,7 @@ else:
mode: Literal["func_type"],
*,
type_comments: bool = False,
feature_version: None | int | tuple[int, int] = None,
feature_version: int | tuple[int, int] | None = None,
) -> FunctionType: ...
@overload
def parse(
Expand All @@ -1962,31 +1962,31 @@ else:
mode: Literal["single"],
*,
type_comments: bool = False,
feature_version: None | int | tuple[int, int] = None,
feature_version: int | tuple[int, int] | None = None,
) -> Interactive: ...
@overload
def parse(
source: str | ReadableBuffer,
*,
mode: Literal["eval"],
type_comments: bool = False,
feature_version: None | int | tuple[int, int] = None,
feature_version: int | tuple[int, int] | None = None,
) -> Expression: ...
@overload
def parse(
source: str | ReadableBuffer,
*,
mode: Literal["func_type"],
type_comments: bool = False,
feature_version: None | int | tuple[int, int] = None,
feature_version: int | tuple[int, int] | None = None,
) -> FunctionType: ...
@overload
def parse(
source: str | ReadableBuffer,
*,
mode: Literal["single"],
type_comments: bool = False,
feature_version: None | int | tuple[int, int] = None,
feature_version: int | tuple[int, int] | None = None,
) -> Interactive: ...
@overload
def parse(
Expand All @@ -1995,7 +1995,7 @@ else:
mode: str = "exec",
*,
type_comments: bool = False,
feature_version: None | int | tuple[int, int] = None,
feature_version: int | tuple[int, int] | None = None,
) -> mod: ...

def literal_eval(node_or_string: str | AST) -> Any: ...
Expand Down
2 changes: 1 addition & 1 deletion stdlib/asyncio/base_events.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ _ProtocolT = TypeVar("_ProtocolT", bound=BaseProtocol)
_Context: TypeAlias = dict[str, Any]
_ExceptionHandler: TypeAlias = Callable[[AbstractEventLoop, _Context], object]
_ProtocolFactory: TypeAlias = Callable[[], BaseProtocol]
_SSLContext: TypeAlias = bool | None | ssl.SSLContext
_SSLContext: TypeAlias = bool | ssl.SSLContext | None

class Server(AbstractServer):
if sys.version_info >= (3, 11):
Expand Down
2 changes: 1 addition & 1 deletion stdlib/asyncio/events.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ _ProtocolT = TypeVar("_ProtocolT", bound=BaseProtocol)
_Context: TypeAlias = dict[str, Any]
_ExceptionHandler: TypeAlias = Callable[[AbstractEventLoop, _Context], object]
_ProtocolFactory: TypeAlias = Callable[[], BaseProtocol]
_SSLContext: TypeAlias = bool | None | ssl.SSLContext
_SSLContext: TypeAlias = bool | ssl.SSLContext | None

@type_check_only
class _TaskFactory(Protocol):
Expand Down
24 changes: 12 additions & 12 deletions stdlib/asyncio/subprocess.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ if sys.version_info >= (3, 11):
restore_signals: bool = True,
start_new_session: bool = False,
pass_fds: Collection[int] = (),
group: None | str | int = None,
extra_groups: None | Collection[str | int] = None,
user: None | str | int = None,
group: str | int | None = None,
extra_groups: Collection[str | int] | None = None,
user: str | int | None = None,
umask: int = -1,
process_group: int | None = None,
pipesize: int = -1,
Expand Down Expand Up @@ -93,9 +93,9 @@ if sys.version_info >= (3, 11):
restore_signals: bool = True,
start_new_session: bool = False,
pass_fds: Collection[int] = (),
group: None | str | int = None,
extra_groups: None | Collection[str | int] = None,
user: None | str | int = None,
group: str | int | None = None,
extra_groups: Collection[str | int] | None = None,
user: str | int | None = None,
umask: int = -1,
process_group: int | None = None,
pipesize: int = -1,
Expand Down Expand Up @@ -127,9 +127,9 @@ else:
restore_signals: bool = True,
start_new_session: bool = False,
pass_fds: Collection[int] = (),
group: None | str | int = None,
extra_groups: None | Collection[str | int] = None,
user: None | str | int = None,
group: str | int | None = None,
extra_groups: Collection[str | int] | None = None,
user: str | int | None = None,
umask: int = -1,
pipesize: int = -1,
) -> Process: ...
Expand Down Expand Up @@ -158,9 +158,9 @@ else:
restore_signals: bool = True,
start_new_session: bool = False,
pass_fds: Collection[int] = (),
group: None | str | int = None,
extra_groups: None | Collection[str | int] = None,
user: None | str | int = None,
group: str | int | None = None,
extra_groups: Collection[str | int] | None = None,
user: str | int | None = None,
umask: int = -1,
pipesize: int = -1,
) -> Process: ...
2 changes: 1 addition & 1 deletion stdlib/cgi.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class FieldStorage:
length: int
done: int
list: _list[Any] | None
value: None | bytes | _list[Any]
value: bytes | _list[Any] | None
def __init__(
self,
fp: IO[Any] | None = None,
Expand Down
Loading
Loading