mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-01 17:13:24 +08:00
Add _typeshed.(Opt)ExcInfo (#7645)
This commit is contained in:
@@ -7,7 +7,8 @@ import ctypes
|
||||
import mmap
|
||||
import sys
|
||||
from os import PathLike
|
||||
from typing import AbstractSet, Any, Awaitable, Container, Generic, Iterable, Protocol, TypeVar
|
||||
from types import TracebackType
|
||||
from typing import AbstractSet, Any, Awaitable, Container, Generic, Iterable, Protocol, TypeVar, Union
|
||||
from typing_extensions import Final, Literal, TypeAlias, final
|
||||
|
||||
_KT = TypeVar("_KT")
|
||||
@@ -197,6 +198,9 @@ WriteableBuffer: TypeAlias = bytearray | memoryview | array.array[Any] | mmap.mm
|
||||
# Same as _WriteableBuffer, but also includes read-only buffer types (like bytes).
|
||||
ReadableBuffer: TypeAlias = ReadOnlyBuffer | WriteableBuffer # stable
|
||||
|
||||
ExcInfo: TypeAlias = tuple[type[BaseException], BaseException, TracebackType]
|
||||
OptExcInfo: TypeAlias = Union[ExcInfo, tuple[None, None, None]]
|
||||
|
||||
# stable
|
||||
if sys.version_info >= (3, 10):
|
||||
from types import NoneType as NoneType
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# See the README.md file in this directory for more information.
|
||||
|
||||
import sys
|
||||
from sys import _OptExcInfo
|
||||
from _typeshed import OptExcInfo
|
||||
from typing import Any, Callable, Iterable, Protocol
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
@@ -19,7 +19,7 @@ else:
|
||||
# stable
|
||||
class StartResponse(Protocol):
|
||||
def __call__(
|
||||
self, __status: str, __headers: list[tuple[str, str]], __exc_info: _OptExcInfo | None = ...
|
||||
self, __status: str, __headers: list[tuple[str, str]], __exc_info: OptExcInfo | None = ...
|
||||
) -> Callable[[bytes], object]: ...
|
||||
|
||||
WSGIEnvironment: TypeAlias = dict[str, Any] # stable
|
||||
|
||||
Reference in New Issue
Block a user