Use PEP 604 syntax wherever possible (#7493)

This commit is contained in:
Alex Waygood
2022-03-16 15:01:33 +00:00
committed by GitHub
parent 15e21a8dc1
commit 3ab250eec8
174 changed files with 472 additions and 490 deletions

View File

@@ -2,7 +2,7 @@ import sys
from _typeshed import structseq
from enum import IntEnum
from types import FrameType
from typing import Any, Callable, Iterable, Optional, Union
from typing import Any, Callable, Iterable, Union
from typing_extensions import final
NSIG: int
@@ -60,8 +60,8 @@ class Handlers(IntEnum):
SIG_DFL: Handlers
SIG_IGN: Handlers
_SIGNUM = Union[int, Signals]
_HANDLER = Union[Callable[[int, Optional[FrameType]], Any], int, Handlers, None]
_SIGNUM = int | Signals
_HANDLER = Union[Callable[[int, FrameType | None], Any], int, Handlers, None]
def default_int_handler(__signalnum: int, __frame: FrameType | None) -> None: ...