diff --git a/stdlib/_sitebuiltins.pyi b/stdlib/_sitebuiltins.pyi index eb6c81129421..99abd02386b2 100644 --- a/stdlib/_sitebuiltins.pyi +++ b/stdlib/_sitebuiltins.pyi @@ -1,12 +1,13 @@ import sys from collections.abc import Iterable -from typing import ClassVar, Literal, NoReturn +from typing import ClassVar, Literal +from typing_extensions import Never class Quitter: name: str eof: str def __init__(self, name: str, eof: str) -> None: ... - def __call__(self, code: sys._ExitCode = None) -> NoReturn: ... + def __call__(self, code: sys._ExitCode = None) -> Never: ... class _Printer: MAXLINES: ClassVar[Literal[23]] diff --git a/stdlib/_thread.pyi b/stdlib/_thread.pyi index 378ac2423757..4ac8cccaf3cf 100644 --- a/stdlib/_thread.pyi +++ b/stdlib/_thread.pyi @@ -4,8 +4,8 @@ from _typeshed import structseq from collections.abc import Callable from threading import Thread from types import TracebackType -from typing import Any, Final, NoReturn, final, overload -from typing_extensions import TypeVarTuple, Unpack +from typing import Any, Final, final, overload +from typing_extensions import Never, TypeVarTuple, Unpack _Ts = TypeVarTuple("_Ts") @@ -76,8 +76,8 @@ if sys.version_info >= (3, 10): else: def interrupt_main() -> None: ... -def exit() -> NoReturn: ... -def exit_thread() -> NoReturn: ... # Obsolete synonym for exit() +def exit() -> Never: ... +def exit_thread() -> Never: ... # Obsolete synonym for exit() def allocate_lock() -> LockType: ... def allocate() -> LockType: ... # Obsolete synonym for allocate_lock() def get_ident() -> int: ... diff --git a/stdlib/_winapi.pyi b/stdlib/_winapi.pyi index 0f71a0687748..dc5a43f4e487 100644 --- a/stdlib/_winapi.pyi +++ b/stdlib/_winapi.pyi @@ -1,7 +1,8 @@ import sys from _typeshed import ReadableBuffer from collections.abc import Sequence -from typing import Any, Final, Literal, NoReturn, final, overload +from typing import Any, Final, Literal, final, overload +from typing_extensions import Never if sys.platform == "win32": ABOVE_NORMAL_PRIORITY_CLASS: Final = 0x8000 @@ -223,7 +224,7 @@ if sys.platform == "win32": options: int = 0, /, ) -> int: ... - def ExitProcess(ExitCode: int, /) -> NoReturn: ... + def ExitProcess(ExitCode: int, /) -> Never: ... def GetACP() -> int: ... def GetFileType(handle: int) -> int: ... def GetCurrentProcess() -> int: ... diff --git a/stdlib/argparse.pyi b/stdlib/argparse.pyi index 32beaff14696..9442d0df2ab5 100644 --- a/stdlib/argparse.pyi +++ b/stdlib/argparse.pyi @@ -2,8 +2,8 @@ import sys from _typeshed import SupportsWrite, sentinel from collections.abc import Callable, Generator, Iterable, Sequence from re import Pattern -from typing import IO, Any, ClassVar, Final, Generic, NoReturn, Protocol, TypeVar, overload -from typing_extensions import Self, TypeAlias, deprecated +from typing import IO, Any, ClassVar, Final, Generic, Protocol, TypeVar, overload +from typing_extensions import Never, Self, TypeAlias, deprecated __all__ = [ "ArgumentParser", @@ -109,7 +109,7 @@ class _ActionsContainer: def _pop_action_class(self, kwargs: Any, default: type[Action] | None = None) -> type[Action]: ... def _get_handler(self) -> Callable[[Action, Iterable[tuple[str, Action]]], Any]: ... def _check_conflict(self, action: Action) -> None: ... - def _handle_conflict_error(self, action: Action, conflicting_actions: Iterable[tuple[str, Action]]) -> NoReturn: ... + def _handle_conflict_error(self, action: Action, conflicting_actions: Iterable[tuple[str, Action]]) -> Never: ... def _handle_conflict_resolve(self, action: Action, conflicting_actions: Iterable[tuple[str, Action]]) -> None: ... class _FormatterClass(Protocol): @@ -192,8 +192,8 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): @overload def parse_known_args(self, *, namespace: _N) -> tuple[_N, list[str]]: ... def convert_arg_line_to_args(self, arg_line: str) -> list[str]: ... - def exit(self, status: int = 0, message: str | None = None) -> NoReturn: ... - def error(self, message: str) -> NoReturn: ... + def exit(self, status: int = 0, message: str | None = None) -> Never: ... + def error(self, message: str) -> Never: ... @overload def parse_intermixed_args(self, args: Sequence[str] | None = None, namespace: None = None) -> Namespace: ... @overload diff --git a/stdlib/asyncio/trsock.pyi b/stdlib/asyncio/trsock.pyi index e74cf6fd4e05..96d24ef1b0e2 100644 --- a/stdlib/asyncio/trsock.pyi +++ b/stdlib/asyncio/trsock.pyi @@ -4,8 +4,8 @@ from _typeshed import ReadableBuffer from builtins import type as Type # alias to avoid name clashes with property named "type" from collections.abc import Iterable from types import TracebackType -from typing import Any, BinaryIO, NoReturn, overload -from typing_extensions import TypeAlias +from typing import Any, BinaryIO, overload +from typing_extensions import Never, TypeAlias # These are based in socket, maybe move them out into _typeshed.pyi or such _Address: TypeAlias = socket._Address @@ -21,7 +21,7 @@ class TransportSocket: def type(self) -> int: ... @property def proto(self) -> int: ... - def __getstate__(self) -> NoReturn: ... + def __getstate__(self) -> Never: ... def fileno(self) -> int: ... def dup(self) -> socket.socket: ... def get_inheritable(self) -> bool: ... @@ -36,7 +36,7 @@ class TransportSocket: def setsockopt(self, level: int, optname: int, value: None, optlen: int) -> None: ... def getpeername(self) -> _RetAddress: ... def getsockname(self) -> _RetAddress: ... - def getsockbyname(self) -> NoReturn: ... # This method doesn't exist on socket, yet is passed through? + def getsockbyname(self) -> Never: ... # This method doesn't exist on socket, yet is passed through? def settimeout(self, value: float | None) -> None: ... def gettimeout(self) -> float | None: ... def setblocking(self, flag: bool) -> None: ... @@ -49,7 +49,7 @@ class TransportSocket: if sys.platform == "win32": def ioctl(self, control: int, option: int | tuple[int, int, int] | bool) -> None: ... else: - def ioctl(self, control: int, option: int | tuple[int, int, int] | bool) -> NoReturn: ... + def ioctl(self, control: int, option: int | tuple[int, int, int] | bool) -> Never: ... def listen(self, backlog: int = ..., /) -> None: ... def makefile(self) -> BinaryIO: ... @@ -63,7 +63,7 @@ class TransportSocket: else: def sendmsg_afalg( self, msg: Iterable[ReadableBuffer] = ..., *, op: int, iv: Any = ..., assoclen: int = ..., flags: int = ... - ) -> NoReturn: ... + ) -> Never: ... def sendmsg( self, buffers: Iterable[ReadableBuffer], ancdata: Iterable[_CMSG] = ..., flags: int = ..., address: _Address = ..., / @@ -78,7 +78,7 @@ class TransportSocket: if sys.platform == "win32": def share(self, process_id: int) -> bytes: ... else: - def share(self, process_id: int) -> NoReturn: ... + def share(self, process_id: int) -> Never: ... def recv_into(self, buffer: _WriteBuffer, nbytes: int = ..., flags: int = ...) -> int: ... def recvfrom_into(self, buffer: _WriteBuffer, nbytes: int = ..., flags: int = ...) -> tuple[int, _RetAddress]: ... diff --git a/stdlib/asyncio/windows_events.pyi b/stdlib/asyncio/windows_events.pyi index 2ffc2eccb228..39a87c417f1e 100644 --- a/stdlib/asyncio/windows_events.pyi +++ b/stdlib/asyncio/windows_events.pyi @@ -2,7 +2,8 @@ import socket import sys from _typeshed import Incomplete, ReadableBuffer, WriteableBuffer from collections.abc import Callable -from typing import IO, Any, ClassVar, Final, NoReturn +from typing import IO, Any, ClassVar, Final +from typing_extensions import Never from . import events, futures, proactor_events, selector_events, streams, windows_utils @@ -88,13 +89,13 @@ if sys.platform == "win32": class WindowsSelectorEventLoopPolicy(events.BaseDefaultEventLoopPolicy): _loop_factory: ClassVar[type[SelectorEventLoop]] if sys.version_info < (3, 14): - def get_child_watcher(self) -> NoReturn: ... - def set_child_watcher(self, watcher: Any) -> NoReturn: ... + def get_child_watcher(self) -> Never: ... + def set_child_watcher(self, watcher: Any) -> Never: ... class WindowsProactorEventLoopPolicy(events.BaseDefaultEventLoopPolicy): _loop_factory: ClassVar[type[ProactorEventLoop]] - def get_child_watcher(self) -> NoReturn: ... - def set_child_watcher(self, watcher: Any) -> NoReturn: ... + def get_child_watcher(self) -> Never: ... + def set_child_watcher(self, watcher: Any) -> Never: ... DefaultEventLoopPolicy = WindowsSelectorEventLoopPolicy if sys.version_info >= (3, 13): diff --git a/stdlib/collections/__init__.pyi b/stdlib/collections/__init__.pyi index b9e4f84ec0b6..16f0d2c20c5c 100644 --- a/stdlib/collections/__init__.pyi +++ b/stdlib/collections/__init__.pyi @@ -2,8 +2,8 @@ import sys from _collections_abc import dict_items, dict_keys, dict_values from _typeshed import SupportsItems, SupportsKeysAndGetItem, SupportsRichComparison, SupportsRichComparisonT from types import GenericAlias -from typing import Any, ClassVar, Generic, NoReturn, SupportsIndex, TypeVar, final, overload -from typing_extensions import Self +from typing import Any, ClassVar, Generic, SupportsIndex, TypeVar, final, overload +from typing_extensions import Never, Self if sys.version_info >= (3, 10): from collections.abc import ( @@ -281,7 +281,7 @@ class Counter(dict[_T, int], Generic[_T]): def elements(self) -> Iterator[_T]: ... def most_common(self, n: int | None = None) -> list[tuple[_T, int]]: ... @classmethod - def fromkeys(cls, iterable: Any, v: int | None = None) -> NoReturn: ... # type: ignore[override] + def fromkeys(cls, iterable: Any, v: int | None = None) -> Never: ... # type: ignore[override] @overload def subtract(self, iterable: None = None, /) -> None: ... @overload diff --git a/stdlib/datetime.pyi b/stdlib/datetime.pyi index 72fb5fceb1fb..305c73b90908 100644 --- a/stdlib/datetime.pyi +++ b/stdlib/datetime.pyi @@ -1,8 +1,8 @@ import sys from abc import abstractmethod from time import struct_time -from typing import ClassVar, Final, NoReturn, SupportsIndex, final, overload, type_check_only -from typing_extensions import CapsuleType, Self, TypeAlias, deprecated +from typing import ClassVar, Final, SupportsIndex, final, overload, type_check_only +from typing_extensions import CapsuleType, Never, Self, TypeAlias, deprecated if sys.version_info >= (3, 11): __all__ = ("date", "datetime", "time", "timedelta", "timezone", "tzinfo", "MINYEAR", "MAXYEAR", "UTC") @@ -97,7 +97,7 @@ class date: def __add__(self, value: timedelta, /) -> Self: ... def __radd__(self, value: timedelta, /) -> Self: ... @overload - def __sub__(self, value: datetime, /) -> NoReturn: ... + def __sub__(self, value: datetime, /) -> Never: ... @overload def __sub__(self, value: Self, /) -> timedelta: ... @overload diff --git a/stdlib/importlib/readers.pyi b/stdlib/importlib/readers.pyi index 4a6c73921535..22e428fdc644 100644 --- a/stdlib/importlib/readers.pyi +++ b/stdlib/importlib/readers.pyi @@ -8,7 +8,7 @@ import zipfile from _typeshed import StrPath from collections.abc import Iterable, Iterator from io import BufferedReader -from typing import Literal, NoReturn, TypeVar +from typing import Literal, TypeVar from typing_extensions import Never if sys.version_info >= (3, 10): @@ -46,8 +46,8 @@ if sys.version_info >= (3, 10): class MultiplexedPath(abc.Traversable): def __init__(self, *paths: abc.Traversable) -> None: ... def iterdir(self) -> Iterator[abc.Traversable]: ... - def read_bytes(self) -> NoReturn: ... - def read_text(self, *args: Never, **kwargs: Never) -> NoReturn: ... # type: ignore[override] + def read_bytes(self) -> Never: ... + def read_text(self, *args: Never, **kwargs: Never) -> Never: ... # type: ignore[override] def is_dir(self) -> Literal[True]: ... def is_file(self) -> Literal[False]: ... @@ -61,7 +61,7 @@ if sys.version_info >= (3, 10): if sys.version_info < (3, 12): __truediv__ = joinpath - def open(self, *args: Never, **kwargs: Never) -> NoReturn: ... # type: ignore[override] + def open(self, *args: Never, **kwargs: Never) -> Never: ... # type: ignore[override] @property def name(self) -> str: ... diff --git a/stdlib/importlib/resources/simple.pyi b/stdlib/importlib/resources/simple.pyi index c4c758111c2d..5e44eed0b85e 100644 --- a/stdlib/importlib/resources/simple.pyi +++ b/stdlib/importlib/resources/simple.pyi @@ -2,7 +2,7 @@ import abc import sys from collections.abc import Iterator from io import TextIOWrapper -from typing import IO, Any, BinaryIO, Literal, NoReturn, overload +from typing import IO, Any, BinaryIO, Literal, overload from typing_extensions import Never if sys.version_info >= (3, 11): @@ -40,7 +40,7 @@ if sys.version_info >= (3, 11): def open(self, mode: Literal["rb"]) -> BinaryIO: ... @overload def open(self, mode: str) -> IO[Any]: ... - def joinpath(self, name: Never) -> NoReturn: ... # type: ignore[override] + def joinpath(self, name: Never) -> Never: ... # type: ignore[override] class ResourceContainer(Traversable, metaclass=abc.ABCMeta): reader: SimpleReader @@ -48,7 +48,7 @@ if sys.version_info >= (3, 11): def is_dir(self) -> Literal[True]: ... def is_file(self) -> Literal[False]: ... def iterdir(self) -> Iterator[ResourceHandle | ResourceContainer]: ... - def open(self, *args: Never, **kwargs: Never) -> NoReturn: ... # type: ignore[override] + def open(self, *args: Never, **kwargs: Never) -> Never: ... # type: ignore[override] if sys.version_info < (3, 12): def joinpath(self, *descendants: str) -> Traversable: ... diff --git a/stdlib/lib2to3/pgen2/pgen.pyi b/stdlib/lib2to3/pgen2/pgen.pyi index 5776d100d1da..74a21c8fea1f 100644 --- a/stdlib/lib2to3/pgen2/pgen.pyi +++ b/stdlib/lib2to3/pgen2/pgen.pyi @@ -1,6 +1,7 @@ from _typeshed import Incomplete, StrPath from collections.abc import Iterable, Iterator -from typing import IO, ClassVar, NoReturn, overload +from typing import IO, ClassVar, overload +from typing_extensions import Never from . import grammar from .tokenize import _TokenInfo @@ -30,9 +31,9 @@ class ParserGenerator: def expect(self, type: int, value: str | None = None) -> str: ... def gettoken(self) -> None: ... @overload - def raise_error(self, msg: object) -> NoReturn: ... + def raise_error(self, msg: object) -> Never: ... @overload - def raise_error(self, msg: str, *args: object) -> NoReturn: ... + def raise_error(self, msg: str, *args: object) -> Never: ... class NFAState: arcs: list[tuple[str | None, NFAState]] diff --git a/stdlib/lib2to3/refactor.pyi b/stdlib/lib2to3/refactor.pyi index a7f382540648..801124305d29 100644 --- a/stdlib/lib2to3/refactor.pyi +++ b/stdlib/lib2to3/refactor.pyi @@ -3,7 +3,8 @@ from collections.abc import Container, Generator, Iterable, Mapping from logging import Logger, _ExcInfoType from multiprocessing import JoinableQueue from multiprocessing.synchronize import Lock -from typing import Any, ClassVar, Final, NoReturn, overload +from typing import Any, ClassVar, Final, overload +from typing_extensions import Never from .btm_matcher import BottomMatcher from .fixer_base import BaseFix @@ -39,7 +40,7 @@ class RefactoringTool: self, fixer_names: Iterable[str], options: Mapping[str, object] | None = None, explicit: Container[str] | None = None ) -> None: ... def get_fixers(self) -> tuple[list[BaseFix], list[BaseFix]]: ... - def log_error(self, msg: str, *args: Iterable[str], **kwargs: _ExcInfoType) -> NoReturn: ... + def log_error(self, msg: str, *args: Iterable[str], **kwargs: _ExcInfoType) -> Never: ... @overload def log_message(self, msg: object) -> None: ... @overload diff --git a/stdlib/mmap.pyi b/stdlib/mmap.pyi index c9b8358cde6c..ce9f15a92198 100644 --- a/stdlib/mmap.pyi +++ b/stdlib/mmap.pyi @@ -1,8 +1,8 @@ import sys from _typeshed import ReadableBuffer, Unused from collections.abc import Iterator -from typing import Final, Literal, NoReturn, overload -from typing_extensions import Self +from typing import Final, Literal, overload +from typing_extensions import Never, Self ACCESS_DEFAULT: int ACCESS_READ: int @@ -74,7 +74,7 @@ class mmap: def __getitem__(self, key: int, /) -> int: ... @overload def __getitem__(self, key: slice, /) -> bytes: ... - def __delitem__(self, key: int | slice, /) -> NoReturn: ... + def __delitem__(self, key: int | slice, /) -> Never: ... @overload def __setitem__(self, key: int, value: int, /) -> None: ... @overload diff --git a/stdlib/optparse.pyi b/stdlib/optparse.pyi index 8b7fcd82e5a5..2348bd07fa48 100644 --- a/stdlib/optparse.pyi +++ b/stdlib/optparse.pyi @@ -2,8 +2,8 @@ import builtins from _typeshed import MaybeNone, SupportsWrite from abc import abstractmethod from collections.abc import Callable, Iterable, Mapping, Sequence -from typing import Any, ClassVar, Final, Literal, NoReturn, overload -from typing_extensions import Self +from typing import Any, ClassVar, Final, Literal, overload +from typing_extensions import Never, Self __all__ = [ "Option", @@ -288,8 +288,8 @@ class OptionParser(OptionContainer): def check_values(self, values: Values, args: list[str]) -> tuple[Values, list[str]]: ... def disable_interspersed_args(self) -> None: ... def enable_interspersed_args(self) -> None: ... - def error(self, msg: str) -> NoReturn: ... - def exit(self, status: int = 0, msg: str | None = None) -> NoReturn: ... + def error(self, msg: str) -> Never: ... + def exit(self, status: int = 0, msg: str | None = None) -> Never: ... def expand_prog_name(self, s: str) -> str: ... def format_epilog(self, formatter: HelpFormatter) -> str: ... def format_help(self, formatter: HelpFormatter | None = None) -> str: ... diff --git a/stdlib/os/__init__.pyi b/stdlib/os/__init__.pyi index d0ef614abbce..9a6a23b0a7f2 100644 --- a/stdlib/os/__init__.pyi +++ b/stdlib/os/__init__.pyi @@ -25,22 +25,8 @@ from collections.abc import Callable, Iterable, Iterator, Mapping, MutableMappin from io import BufferedRandom, BufferedReader, BufferedWriter, FileIO, TextIOWrapper from subprocess import Popen from types import GenericAlias, TracebackType -from typing import ( - IO, - Any, - AnyStr, - BinaryIO, - Final, - Generic, - Literal, - NoReturn, - Protocol, - TypeVar, - final, - overload, - runtime_checkable, -) -from typing_extensions import Self, TypeAlias, Unpack, deprecated +from typing import IO, Any, AnyStr, BinaryIO, Final, Generic, Literal, Protocol, TypeVar, final, overload, runtime_checkable +from typing_extensions import Never, Self, TypeAlias, Unpack, deprecated from . import path as _path @@ -1305,19 +1291,17 @@ if sys.platform != "win32": follow_symlinks: bool = True, ) -> None: ... -def abort() -> NoReturn: ... +def abort() -> Never: ... # These are defined as execl(file, *args) but the first *arg is mandatory. -def execl(file: StrOrBytesPath, *args: Unpack[tuple[StrOrBytesPath, Unpack[tuple[StrOrBytesPath, ...]]]]) -> NoReturn: ... -def execlp(file: StrOrBytesPath, *args: Unpack[tuple[StrOrBytesPath, Unpack[tuple[StrOrBytesPath, ...]]]]) -> NoReturn: ... +def execl(file: StrOrBytesPath, *args: Unpack[tuple[StrOrBytesPath, Unpack[tuple[StrOrBytesPath, ...]]]]) -> Never: ... +def execlp(file: StrOrBytesPath, *args: Unpack[tuple[StrOrBytesPath, Unpack[tuple[StrOrBytesPath, ...]]]]) -> Never: ... # These are: execle(file, *args, env) but env is pulled from the last element of the args. -def execle( - file: StrOrBytesPath, *args: Unpack[tuple[StrOrBytesPath, Unpack[tuple[StrOrBytesPath, ...]], _ExecEnv]] -) -> NoReturn: ... +def execle(file: StrOrBytesPath, *args: Unpack[tuple[StrOrBytesPath, Unpack[tuple[StrOrBytesPath, ...]], _ExecEnv]]) -> Never: ... def execlpe( file: StrOrBytesPath, *args: Unpack[tuple[StrOrBytesPath, Unpack[tuple[StrOrBytesPath, ...]], _ExecEnv]] -) -> NoReturn: ... +) -> Never: ... # The docs say `args: tuple or list of strings` # The implementation enforces tuple or list so we can't use Sequence. @@ -1340,11 +1324,11 @@ _ExecVArgs: TypeAlias = ( # we limit to str | bytes. _ExecEnv: TypeAlias = Mapping[bytes, bytes | str] | Mapping[str, bytes | str] -def execv(path: StrOrBytesPath, argv: _ExecVArgs, /) -> NoReturn: ... -def execve(path: FileDescriptorOrPath, argv: _ExecVArgs, env: _ExecEnv) -> NoReturn: ... -def execvp(file: StrOrBytesPath, args: _ExecVArgs) -> NoReturn: ... -def execvpe(file: StrOrBytesPath, args: _ExecVArgs, env: _ExecEnv) -> NoReturn: ... -def _exit(status: int) -> NoReturn: ... +def execv(path: StrOrBytesPath, argv: _ExecVArgs, /) -> Never: ... +def execve(path: FileDescriptorOrPath, argv: _ExecVArgs, env: _ExecEnv) -> Never: ... +def execvp(file: StrOrBytesPath, args: _ExecVArgs) -> Never: ... +def execvpe(file: StrOrBytesPath, args: _ExecVArgs, env: _ExecEnv) -> Never: ... +def _exit(status: int) -> Never: ... def kill(pid: int, signal: int, /) -> None: ... if sys.platform != "win32": diff --git a/stdlib/poplib.pyi b/stdlib/poplib.pyi index a1e41be86a7f..e93ff373798d 100644 --- a/stdlib/poplib.pyi +++ b/stdlib/poplib.pyi @@ -3,8 +3,8 @@ import ssl import sys from builtins import list as _list # conflicts with a method named "list" from re import Pattern -from typing import Any, BinaryIO, Final, NoReturn, overload -from typing_extensions import TypeAlias +from typing import Any, BinaryIO, Final, overload +from typing_extensions import Never, TypeAlias __all__ = ["POP3", "error_proto", "POP3_SSL"] @@ -56,7 +56,7 @@ class POP3_SSL(POP3): def __init__( self, host: str, port: int = 995, *, timeout: float = ..., context: ssl.SSLContext | None = None ) -> None: ... - def stls(self, context: Any = None) -> NoReturn: ... + def stls(self, context: Any = None) -> Never: ... else: def __init__( self, @@ -69,4 +69,4 @@ class POP3_SSL(POP3): ) -> None: ... # "context" is actually the last argument, # but that breaks LSP and it doesn't really matter because all the arguments are ignored - def stls(self, context: Any = None, keyfile: Any = None, certfile: Any = None) -> NoReturn: ... + def stls(self, context: Any = None, keyfile: Any = None, certfile: Any = None) -> Never: ... diff --git a/stdlib/pydoc.pyi b/stdlib/pydoc.pyi index f14b9d1bb699..9994ef232e8d 100644 --- a/stdlib/pydoc.pyi +++ b/stdlib/pydoc.pyi @@ -5,8 +5,8 @@ from builtins import list as _list # "list" conflicts with method name from collections.abc import Callable, Container, Mapping, MutableMapping from reprlib import Repr from types import MethodType, ModuleType, TracebackType -from typing import IO, Any, AnyStr, Final, NoReturn, Protocol, TypeVar -from typing_extensions import TypeGuard, deprecated +from typing import IO, Any, AnyStr, Final, Protocol, TypeVar +from typing_extensions import Never, TypeGuard, deprecated __all__ = ["help"] @@ -55,7 +55,7 @@ def safeimport(path: str, forceload: bool = ..., cache: MutableMapping[str, Modu class Doc: PYTHONDOCS: str def document(self, object: object, name: str | None = None, *args: Any) -> str: ... - def fail(self, object: object, name: str | None = None, *args: Any) -> NoReturn: ... + def fail(self, object: object, name: str | None = None, *args: Any) -> Never: ... @abstractmethod def docmodule(self, object: object, name: str | None = None, *args: Any) -> str: ... @abstractmethod diff --git a/stdlib/random.pyi b/stdlib/random.pyi index 83e37113a941..f4120c24853c 100644 --- a/stdlib/random.pyi +++ b/stdlib/random.pyi @@ -3,7 +3,8 @@ import sys from _typeshed import SupportsLenAndGetItem from collections.abc import Callable, Iterable, MutableSequence, Sequence, Set as AbstractSet from fractions import Fraction -from typing import Any, ClassVar, NoReturn, TypeVar +from typing import Any, ClassVar, TypeVar +from typing_extensions import Never __all__ = [ "Random", @@ -97,8 +98,8 @@ class Random(_random.Random): # SystemRandom is not implemented for all OS's; good on Windows & Linux class SystemRandom(Random): def getrandbits(self, k: int) -> int: ... # k can be passed by keyword - def getstate(self, *args: Any, **kwds: Any) -> NoReturn: ... - def setstate(self, *args: Any, **kwds: Any) -> NoReturn: ... + def getstate(self, *args: Any, **kwds: Any) -> Never: ... + def setstate(self, *args: Any, **kwds: Any) -> Never: ... _inst: Random seed = _inst.seed diff --git a/stdlib/shutil.pyi b/stdlib/shutil.pyi index ea2c29d4625f..109d84263aad 100644 --- a/stdlib/shutil.pyi +++ b/stdlib/shutil.pyi @@ -3,8 +3,8 @@ import sys from _typeshed import BytesPath, ExcInfo, FileDescriptorOrPath, MaybeNone, StrOrBytesPath, StrPath, SupportsRead, SupportsWrite from collections.abc import Callable, Iterable, Sequence from tarfile import _TarfileFilter -from typing import Any, AnyStr, NamedTuple, NoReturn, Protocol, TypeVar, overload -from typing_extensions import TypeAlias, deprecated +from typing import Any, AnyStr, NamedTuple, Protocol, TypeVar, overload +from typing_extensions import Never, TypeAlias, deprecated __all__ = [ "copyfileobj", @@ -181,7 +181,7 @@ else: if sys.platform == "win32" and sys.version_info < (3, 12): @overload @deprecated("On Windows before Python 3.12, using a PathLike as `cmd` would always fail or return `None`.") - def which(cmd: os.PathLike[str], mode: int = 1, path: StrPath | None = None) -> NoReturn: ... + def which(cmd: os.PathLike[str], mode: int = 1, path: StrPath | None = None) -> Never: ... @overload def which(cmd: StrPath, mode: int = 1, path: StrPath | None = None) -> str | None: ... diff --git a/stdlib/sunau.pyi b/stdlib/sunau.pyi index d81645cb5687..821d36bee239 100644 --- a/stdlib/sunau.pyi +++ b/stdlib/sunau.pyi @@ -1,6 +1,6 @@ from _typeshed import Unused -from typing import IO, Any, Literal, NamedTuple, NoReturn, overload -from typing_extensions import Self, TypeAlias +from typing import IO, Any, Literal, NamedTuple, overload +from typing_extensions import Never, Self, TypeAlias _File: TypeAlias = str | IO[bytes] @@ -46,7 +46,7 @@ class Au_read: def getcompname(self) -> str: ... def getparams(self) -> _sunau_params: ... def getmarkers(self) -> None: ... - def getmark(self, id: Any) -> NoReturn: ... + def getmark(self, id: Any) -> Never: ... def setpos(self, pos: int) -> None: ... def readframes(self, nframes: int) -> bytes | None: ... diff --git a/stdlib/sys/__init__.pyi b/stdlib/sys/__init__.pyi index 2d894674c4af..ce6af20c9281 100644 --- a/stdlib/sys/__init__.pyi +++ b/stdlib/sys/__init__.pyi @@ -5,8 +5,8 @@ from builtins import object as _object from collections.abc import AsyncGenerator, Callable, Sequence from io import TextIOWrapper from types import FrameType, ModuleType, TracebackType -from typing import Any, Final, Literal, NoReturn, Protocol, TextIO, TypeVar, final, type_check_only -from typing_extensions import LiteralString, TypeAlias +from typing import Any, Final, Literal, Protocol, TextIO, TypeVar, final, type_check_only +from typing_extensions import LiteralString, Never, TypeAlias _T = TypeVar("_T") @@ -346,7 +346,7 @@ def exc_info() -> OptExcInfo: ... if sys.version_info >= (3, 11): def exception() -> BaseException | None: ... -def exit(status: _ExitCode = None, /) -> NoReturn: ... +def exit(status: _ExitCode = None, /) -> Never: ... def getallocatedblocks() -> int: ... def getdefaultencoding() -> str: ... @@ -465,7 +465,7 @@ if sys.version_info >= (3, 12): if sys.platform == "linux": def activate_stack_trampoline(backend: str, /) -> None: ... else: - def activate_stack_trampoline(backend: str, /) -> NoReturn: ... + def activate_stack_trampoline(backend: str, /) -> Never: ... from . import _monitoring diff --git a/stdlib/typing_extensions.pyi b/stdlib/typing_extensions.pyi index bad5fae880c0..2bc3df3c6d1c 100644 --- a/stdlib/typing_extensions.pyi +++ b/stdlib/typing_extensions.pyi @@ -580,7 +580,7 @@ else: def __module__(self) -> str | None: ... # type: ignore[override] # Returns typing._GenericAlias, which isn't stubbed. def __getitem__(self, parameters: Incomplete | tuple[Incomplete, ...]) -> Any: ... - def __init_subclass__(cls, *args: Unused, **kwargs: Unused) -> NoReturn: ... + def __init_subclass__(cls, *args: Unused, **kwargs: Unused) -> Never: ... if sys.version_info >= (3, 10): def __or__(self, right: Any) -> _SpecialForm: ... def __ror__(self, left: Any) -> _SpecialForm: ... diff --git a/stdlib/unittest/case.pyi b/stdlib/unittest/case.pyi index 7d1a382a54a4..56a01d48f6f0 100644 --- a/stdlib/unittest/case.pyi +++ b/stdlib/unittest/case.pyi @@ -6,7 +6,7 @@ from collections.abc import Callable, Container, Iterable, Mapping, Sequence, Se from contextlib import AbstractContextManager from re import Pattern from types import GenericAlias, TracebackType -from typing import Any, AnyStr, Final, Generic, NoReturn, Protocol, SupportsAbs, SupportsRound, TypeVar, overload +from typing import Any, AnyStr, Final, Generic, Protocol, SupportsAbs, SupportsRound, TypeVar, overload from typing_extensions import Never, ParamSpec, Self, TypeAlias from unittest._log import _AssertLogsContext, _LoggingWatcher from warnings import WarningMessage @@ -86,7 +86,7 @@ class TestCase: def tearDownClass(cls) -> None: ... def run(self, result: unittest.result.TestResult | None = None) -> unittest.result.TestResult | None: ... def __call__(self, result: unittest.result.TestResult | None = ...) -> unittest.result.TestResult | None: ... - def skipTest(self, reason: Any) -> NoReturn: ... + def skipTest(self, reason: Any) -> Never: ... def subTest(self, msg: Any = ..., **params: Any) -> AbstractContextManager[None]: ... def debug(self) -> None: ... if sys.version_info < (3, 11): @@ -243,7 +243,7 @@ class TestCase: # assertDictEqual accepts only true dict instances. We can't use that here, since that would make # assertDictEqual incompatible with TypedDict. def assertDictEqual(self, d1: Mapping[Any, object], d2: Mapping[Any, object], msg: Any = None) -> None: ... - def fail(self, msg: Any = None) -> NoReturn: ... + def fail(self, msg: Any = None) -> Never: ... def countTestCases(self) -> int: ... def defaultTestResult(self) -> unittest.result.TestResult: ... def id(self) -> str: ... diff --git a/stdlib/urllib/request.pyi b/stdlib/urllib/request.pyi index 1f453fd1e1d6..20d70b49a1e5 100644 --- a/stdlib/urllib/request.pyi +++ b/stdlib/urllib/request.pyi @@ -6,8 +6,8 @@ from email.message import Message from http.client import HTTPConnection, HTTPMessage, HTTPResponse from http.cookiejar import CookieJar from re import Pattern -from typing import IO, Any, ClassVar, NoReturn, Protocol, TypeVar, overload -from typing_extensions import TypeAlias +from typing import IO, Any, ClassVar, Protocol, TypeVar, overload +from typing_extensions import Never, TypeAlias from urllib.error import HTTPError as HTTPError from urllib.response import addclosehook, addinfourl @@ -304,7 +304,7 @@ class CacheFTPHandler(FTPHandler): def clear_cache(self) -> None: ... # undocumented class UnknownHandler(BaseHandler): - def unknown_open(self, req: Request) -> NoReturn: ... + def unknown_open(self, req: Request) -> Never: ... class HTTPErrorProcessor(BaseHandler): def http_response(self, request: Request, response: HTTPResponse) -> _UrlopenRet: ... diff --git a/stdlib/wave.pyi b/stdlib/wave.pyi index ddc6f6bd02a5..b18d60e3773f 100644 --- a/stdlib/wave.pyi +++ b/stdlib/wave.pyi @@ -1,6 +1,6 @@ from _typeshed import ReadableBuffer, Unused -from typing import IO, Any, BinaryIO, Final, Literal, NamedTuple, NoReturn, overload -from typing_extensions import Self, TypeAlias, deprecated +from typing import IO, Any, BinaryIO, Final, Literal, NamedTuple, overload +from typing_extensions import Never, Self, TypeAlias, deprecated __all__ = ["open", "Error", "Wave_read", "Wave_write"] @@ -37,7 +37,7 @@ class Wave_read: @deprecated("Deprecated in Python 3.13; removal scheduled for Python 3.15") def getmarkers(self) -> None: ... @deprecated("Deprecated in Python 3.13; removal scheduled for Python 3.15") - def getmark(self, id: Any) -> NoReturn: ... + def getmark(self, id: Any) -> Never: ... def setpos(self, pos: int) -> None: ... def readframes(self, nframes: int) -> bytes: ... @@ -60,9 +60,9 @@ class Wave_write: def setparams(self, params: _wave_params | tuple[int, int, int, int, str, str]) -> None: ... def getparams(self) -> _wave_params: ... @deprecated("Deprecated in Python 3.13; removal scheduled for Python 3.15") - def setmark(self, id: Any, pos: Any, name: Any) -> NoReturn: ... + def setmark(self, id: Any, pos: Any, name: Any) -> Never: ... @deprecated("Deprecated in Python 3.13; removal scheduled for Python 3.15") - def getmark(self, id: Any) -> NoReturn: ... + def getmark(self, id: Any) -> Never: ... @deprecated("Deprecated in Python 3.13; removal scheduled for Python 3.15") def getmarkers(self) -> None: ... def tell(self) -> int: ... diff --git a/stdlib/wsgiref/validate.pyi b/stdlib/wsgiref/validate.pyi index fa8a6bbb8d03..d1ac26ea3ef9 100644 --- a/stdlib/wsgiref/validate.pyi +++ b/stdlib/wsgiref/validate.pyi @@ -1,7 +1,7 @@ from _typeshed.wsgi import ErrorStream, InputStream, WSGIApplication from collections.abc import Callable, Iterable, Iterator -from typing import Any, NoReturn -from typing_extensions import TypeAlias +from typing import Any +from typing_extensions import Never, TypeAlias __all__ = ["validator"] @@ -16,7 +16,7 @@ class InputWrapper: def readline(self, size: int = ...) -> bytes: ... def readlines(self, hint: int = ...) -> bytes: ... def __iter__(self) -> Iterator[bytes]: ... - def close(self) -> NoReturn: ... + def close(self) -> Never: ... class ErrorWrapper: errors: ErrorStream @@ -24,7 +24,7 @@ class ErrorWrapper: def write(self, s: str) -> None: ... def flush(self) -> None: ... def writelines(self, seq: Iterable[str]) -> None: ... - def close(self) -> NoReturn: ... + def close(self) -> Never: ... _WriterCallback: TypeAlias = Callable[[bytes], Any] diff --git a/stdlib/xml/dom/expatbuilder.pyi b/stdlib/xml/dom/expatbuilder.pyi index 228ad07e15ad..72783f36754d 100644 --- a/stdlib/xml/dom/expatbuilder.pyi +++ b/stdlib/xml/dom/expatbuilder.pyi @@ -1,6 +1,6 @@ from _typeshed import ReadableBuffer, SupportsRead -from typing import Any, NoReturn -from typing_extensions import TypeAlias +from typing import Any +from typing_extensions import Never, TypeAlias from xml.dom.minidom import Document, DocumentFragment, DOMImplementation, Element, Node, TypeInfo from xml.dom.xmlbuilder import DOMBuilderFilter, Options from xml.parsers.expat import XMLParserType @@ -111,8 +111,8 @@ class InternalSubsetExtractor(ExpatBuilder): def start_doctype_decl_handler( # type: ignore[override] self, name: str, publicId: str | None, systemId: str | None, has_internal_subset: bool ) -> None: ... - def end_doctype_decl_handler(self) -> NoReturn: ... - def start_element_handler(self, name: str, attrs: list[str]) -> NoReturn: ... + def end_doctype_decl_handler(self) -> Never: ... + def start_element_handler(self, name: str, attrs: list[str]) -> Never: ... def parse(file: str | SupportsRead[ReadableBuffer | str], namespaces: bool = True) -> Document: ... def parseString(string: str | ReadableBuffer, namespaces: bool = True) -> Document: ... diff --git a/stdlib/xml/dom/minidom.pyi b/stdlib/xml/dom/minidom.pyi index ab2ef87e38a8..f83ebcff8b5f 100644 --- a/stdlib/xml/dom/minidom.pyi +++ b/stdlib/xml/dom/minidom.pyi @@ -3,8 +3,8 @@ from _collections_abc import dict_keys, dict_values from _typeshed import Incomplete, ReadableBuffer, SupportsRead, SupportsWrite from collections.abc import Iterable, Sequence from types import TracebackType -from typing import Any, ClassVar, Generic, Literal, NoReturn, Protocol, TypeVar, overload -from typing_extensions import Self, TypeAlias +from typing import Any, ClassVar, Generic, Literal, Protocol, TypeVar, overload +from typing_extensions import Never, Self, TypeAlias from xml.dom.minicompat import EmptyNodeList, NodeList from xml.dom.xmlbuilder import DocumentLS, DOMImplementationLS from xml.sax.xmlreader import XMLReader @@ -335,14 +335,14 @@ class Childless: def firstChild(self) -> None: ... @property def lastChild(self) -> None: ... - def appendChild(self, node: _NodesThatAreChildren | DocumentFragment) -> NoReturn: ... + def appendChild(self, node: _NodesThatAreChildren | DocumentFragment) -> Never: ... def hasChildNodes(self) -> Literal[False]: ... def insertBefore( self, newChild: _NodesThatAreChildren | DocumentFragment, refChild: _NodesThatAreChildren | None - ) -> NoReturn: ... - def removeChild(self, oldChild: _NodesThatAreChildren) -> NoReturn: ... + ) -> Never: ... + def removeChild(self, oldChild: _NodesThatAreChildren) -> Never: ... def normalize(self) -> None: ... - def replaceChild(self, newChild: _NodesThatAreChildren | DocumentFragment, oldChild: _NodesThatAreChildren) -> NoReturn: ... + def replaceChild(self, newChild: _NodesThatAreChildren | DocumentFragment, oldChild: _NodesThatAreChildren) -> Never: ... class ProcessingInstruction(Childless, Node): nodeType: ClassVar[Literal[7]] @@ -464,10 +464,10 @@ class ReadOnlySequentialNamedNodeMap(Generic[_N]): def getNamedItemNS(self, namespaceURI: str | None, localName: str) -> _N | None: ... def __getitem__(self, name_or_tuple: str | _NSName) -> _N | None: ... def item(self, index: int) -> _N | None: ... - def removeNamedItem(self, name: str) -> NoReturn: ... - def removeNamedItemNS(self, namespaceURI: str | None, localName: str) -> NoReturn: ... - def setNamedItem(self, node: Node) -> NoReturn: ... - def setNamedItemNS(self, node: Node) -> NoReturn: ... + def removeNamedItem(self, name: str) -> Never: ... + def removeNamedItemNS(self, namespaceURI: str | None, localName: str) -> Never: ... + def setNamedItem(self, node: Node) -> Never: ... + def setNamedItemNS(self, node: Node) -> Never: ... @property def length(self) -> int: ... @@ -530,10 +530,10 @@ class Entity(Identified, Node): notationName: str | None def __init__(self, name: str, publicId: str | None, systemId: str | None, notation: str | None) -> None: ... - def appendChild(self, newChild: _EntityChildren) -> NoReturn: ... # type: ignore[override] - def insertBefore(self, newChild: _EntityChildren, refChild: _EntityChildren | None) -> NoReturn: ... # type: ignore[override] - def removeChild(self, oldChild: _EntityChildren) -> NoReturn: ... # type: ignore[override] - def replaceChild(self, newChild: _EntityChildren, oldChild: _EntityChildren) -> NoReturn: ... # type: ignore[override] + def appendChild(self, newChild: _EntityChildren) -> Never: ... # type: ignore[override] + def insertBefore(self, newChild: _EntityChildren, refChild: _EntityChildren | None) -> Never: ... # type: ignore[override] + def removeChild(self, oldChild: _EntityChildren) -> Never: ... # type: ignore[override] + def replaceChild(self, newChild: _EntityChildren, oldChild: _EntityChildren) -> Never: ... # type: ignore[override] class Notation(Identified, Childless, Node): nodeType: ClassVar[Literal[12]] diff --git a/stdlib/xml/dom/pulldom.pyi b/stdlib/xml/dom/pulldom.pyi index d9458654c185..4a022e1990cd 100644 --- a/stdlib/xml/dom/pulldom.pyi +++ b/stdlib/xml/dom/pulldom.pyi @@ -1,8 +1,8 @@ import sys from _typeshed import Incomplete, Unused from collections.abc import MutableSequence, Sequence -from typing import Final, Literal, NoReturn -from typing_extensions import Self, TypeAlias +from typing import Final, Literal +from typing_extensions import Never, Self, TypeAlias from xml.dom.minidom import Comment, Document, DOMImplementation, Element, ProcessingInstruction, Text from xml.sax import _SupportsReadClose from xml.sax.handler import ContentHandler @@ -73,8 +73,8 @@ class PullDOM(ContentHandler): class ErrorHandler: def warning(self, exception: BaseException) -> None: ... - def error(self, exception: BaseException) -> NoReturn: ... - def fatalError(self, exception: BaseException) -> NoReturn: ... + def error(self, exception: BaseException) -> Never: ... + def fatalError(self, exception: BaseException) -> Never: ... class DOMEventStream: stream: _SupportsReadClose[bytes] | _SupportsReadClose[str] diff --git a/stdlib/xml/dom/xmlbuilder.pyi b/stdlib/xml/dom/xmlbuilder.pyi index 6fb18bbc4eda..ed6009facb35 100644 --- a/stdlib/xml/dom/xmlbuilder.pyi +++ b/stdlib/xml/dom/xmlbuilder.pyi @@ -1,5 +1,6 @@ from _typeshed import SupportsRead -from typing import Any, Literal, NoReturn +from typing import Any, Literal +from typing_extensions import Never from xml.dom.minidom import Document, Node, _DOMErrorHandler __all__ = ["DOMBuilder", "DOMEntityResolver", "DOMInputSource"] @@ -41,7 +42,7 @@ class DOMBuilder: def getFeature(self, name: str) -> Any: ... def parseURI(self, uri: str) -> Document: ... def parse(self, input: DOMInputSource) -> Document: ... - def parseWithContext(self, input: DOMInputSource, cnode: Node, action: Literal[1, 2, 3, 4]) -> NoReturn: ... + def parseWithContext(self, input: DOMInputSource, cnode: Node, action: Literal[1, 2, 3, 4]) -> Never: ... class DOMEntityResolver: def resolveEntity(self, publicId: str | None, systemId: str) -> DOMInputSource: ... @@ -66,14 +67,14 @@ class DOMBuilderFilter: class DocumentLS: async_: bool - def abort(self) -> NoReturn: ... - def load(self, uri: str) -> NoReturn: ... - def loadXML(self, source: str) -> NoReturn: ... + def abort(self) -> Never: ... + def load(self, uri: str) -> Never: ... + def loadXML(self, source: str) -> Never: ... def saveXML(self, snode: Node | None) -> str: ... class DOMImplementationLS: MODE_SYNCHRONOUS: Literal[1] MODE_ASYNCHRONOUS: Literal[2] def createDOMBuilder(self, mode: Literal[1], schemaType: None) -> DOMBuilder: ... - def createDOMWriter(self) -> NoReturn: ... + def createDOMWriter(self) -> Never: ... def createDOMInputSource(self) -> DOMInputSource: ... diff --git a/stdlib/xml/sax/_exceptions.pyi b/stdlib/xml/sax/_exceptions.pyi index e9cc8856a9c8..8f5e3a827185 100644 --- a/stdlib/xml/sax/_exceptions.pyi +++ b/stdlib/xml/sax/_exceptions.pyi @@ -1,11 +1,11 @@ -from typing import NoReturn +from typing_extensions import Never from xml.sax.xmlreader import Locator class SAXException(Exception): def __init__(self, msg: str, exception: Exception | None = None) -> None: ... def getMessage(self) -> str: ... def getException(self) -> Exception | None: ... - def __getitem__(self, ix: object) -> NoReturn: ... + def __getitem__(self, ix: object) -> Never: ... class SAXParseException(SAXException): def __init__(self, msg: str, exception: Exception | None, locator: Locator) -> None: ... diff --git a/stdlib/xml/sax/handler.pyi b/stdlib/xml/sax/handler.pyi index 550911734596..2b1625b067d9 100644 --- a/stdlib/xml/sax/handler.pyi +++ b/stdlib/xml/sax/handler.pyi @@ -1,18 +1,19 @@ import sys -from typing import Literal, NoReturn, Protocol, type_check_only +from typing import Literal, Protocol, type_check_only +from typing_extensions import Never from xml.sax import xmlreader version: str @type_check_only class _ErrorHandlerProtocol(Protocol): # noqa: Y046 # Protocol is not used - def error(self, exception: BaseException) -> NoReturn: ... - def fatalError(self, exception: BaseException) -> NoReturn: ... + def error(self, exception: BaseException) -> Never: ... + def fatalError(self, exception: BaseException) -> Never: ... def warning(self, exception: BaseException) -> None: ... class ErrorHandler: - def error(self, exception: BaseException) -> NoReturn: ... - def fatalError(self, exception: BaseException) -> NoReturn: ... + def error(self, exception: BaseException) -> Never: ... + def fatalError(self, exception: BaseException) -> Never: ... def warning(self, exception: BaseException) -> None: ... @type_check_only diff --git a/stdlib/xml/sax/saxutils.pyi b/stdlib/xml/sax/saxutils.pyi index a29588faae2a..0f5251def6b0 100644 --- a/stdlib/xml/sax/saxutils.pyi +++ b/stdlib/xml/sax/saxutils.pyi @@ -2,7 +2,8 @@ from _typeshed import SupportsWrite from codecs import StreamReaderWriter, StreamWriter from collections.abc import Mapping from io import RawIOBase, TextIOBase -from typing import Literal, NoReturn +from typing import Literal +from typing_extensions import Never from xml.sax import _Source, handler, xmlreader def escape(data: str, entities: Mapping[str, str] = {}) -> str: ... @@ -32,8 +33,8 @@ class XMLGenerator(handler.ContentHandler): class XMLFilterBase(xmlreader.XMLReader): def __init__(self, parent: xmlreader.XMLReader | None = None) -> None: ... # ErrorHandler methods - def error(self, exception: BaseException) -> NoReturn: ... - def fatalError(self, exception: BaseException) -> NoReturn: ... + def error(self, exception: BaseException) -> Never: ... + def fatalError(self, exception: BaseException) -> Never: ... def warning(self, exception: BaseException) -> None: ... # ContentHandler methods def setDocumentLocator(self, locator: xmlreader.Locator) -> None: ...