|
1 | | -# ruff: noqa: PYI036 # This is the module declaring BaseException |
2 | 1 | import _ast |
3 | 2 | import _sitebuiltins |
4 | 3 | import _typeshed |
@@ -89,8 +88,8 @@ _T2 = TypeVar("_T2") |
89 | 88 | _T3 = TypeVar("_T3") |
90 | 89 | _T4 = TypeVar("_T4") |
91 | 90 | _T5 = TypeVar("_T5") |
92 | | -_SupportsNextT = TypeVar("_SupportsNextT", bound=SupportsNext[Any], covariant=True) |
93 | | -_SupportsAnextT = TypeVar("_SupportsAnextT", bound=SupportsAnext[Any], covariant=True) |
| 91 | +_SupportsNextT_co = TypeVar("_SupportsNextT_co", bound=SupportsNext[Any], covariant=True) |
| 92 | +_SupportsAnextT_co = TypeVar("_SupportsAnextT_co", bound=SupportsAnext[Any], covariant=True) |
94 | 93 | _AwaitableT = TypeVar("_AwaitableT", bound=Awaitable[Any]) |
95 | 94 | _AwaitableT_co = TypeVar("_AwaitableT_co", bound=Awaitable[Any], covariant=True) |
96 | 95 | _P = ParamSpec("_P") |
@@ -870,7 +869,11 @@ class memoryview(Sequence[_I]): |
870 | 869 | def __new__(cls, obj: ReadableBuffer) -> Self: ... |
871 | 870 | def __enter__(self) -> Self: ... |
872 | 871 | def __exit__( |
873 | | - self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None, / |
| 872 | + self, |
| 873 | + exc_type: type[BaseException] | None, # noqa: PYI036 # This is the module declaring BaseException |
| 874 | + exc_val: BaseException | None, |
| 875 | + exc_tb: TracebackType | None, |
| 876 | + /, |
874 | 877 | ) -> None: ... |
875 | 878 | @overload |
876 | 879 | def cast(self, format: Literal["c", "@c"], shape: list[int] | tuple[int, ...] = ...) -> memoryview[bytes]: ... |
@@ -1319,7 +1322,7 @@ class _PathLike(Protocol[AnyStr_co]): |
1319 | 1322 | def __fspath__(self) -> AnyStr_co: ... |
1320 | 1323 |
|
1321 | 1324 | if sys.version_info >= (3, 10): |
1322 | | - def aiter(async_iterable: SupportsAiter[_SupportsAnextT], /) -> _SupportsAnextT: ... |
| 1325 | + def aiter(async_iterable: SupportsAiter[_SupportsAnextT_co], /) -> _SupportsAnextT_co: ... |
1323 | 1326 |
|
1324 | 1327 | class _SupportsSynchronousAnext(Protocol[_AwaitableT_co]): |
1325 | 1328 | def __anext__(self) -> _AwaitableT_co: ... |
@@ -1481,7 +1484,7 @@ class _GetItemIterable(Protocol[_T_co]): |
1481 | 1484 | def __getitem__(self, i: int, /) -> _T_co: ... |
1482 | 1485 |
|
1483 | 1486 | @overload |
1484 | | -def iter(object: SupportsIter[_SupportsNextT], /) -> _SupportsNextT: ... |
| 1487 | +def iter(object: SupportsIter[_SupportsNextT_co], /) -> _SupportsNextT_co: ... |
1485 | 1488 | @overload |
1486 | 1489 | def iter(object: _GetItemIterable[_T], /) -> Iterator[_T]: ... |
1487 | 1490 | @overload |
@@ -1688,17 +1691,17 @@ def print( |
1688 | 1691 | *values: object, sep: str | None = " ", end: str | None = "\n", file: _SupportsWriteAndFlush[str] | None = None, flush: bool |
1689 | 1692 | ) -> None: ... |
1690 | 1693 |
|
1691 | | -_E = TypeVar("_E", contravariant=True) |
1692 | | -_M = TypeVar("_M", contravariant=True) |
| 1694 | +_E_contra = TypeVar("_E_contra", contravariant=True) |
| 1695 | +_M_contra = TypeVar("_M_contra", contravariant=True) |
1693 | 1696 |
|
1694 | | -class _SupportsPow2(Protocol[_E, _T_co]): |
1695 | | - def __pow__(self, other: _E, /) -> _T_co: ... |
| 1697 | +class _SupportsPow2(Protocol[_E_contra, _T_co]): |
| 1698 | + def __pow__(self, other: _E_contra, /) -> _T_co: ... |
1696 | 1699 |
|
1697 | | -class _SupportsPow3NoneOnly(Protocol[_E, _T_co]): |
1698 | | - def __pow__(self, other: _E, modulo: None = None, /) -> _T_co: ... |
| 1700 | +class _SupportsPow3NoneOnly(Protocol[_E_contra, _T_co]): |
| 1701 | + def __pow__(self, other: _E_contra, modulo: None = None, /) -> _T_co: ... |
1699 | 1702 |
|
1700 | | -class _SupportsPow3(Protocol[_E, _M, _T_co]): |
1701 | | - def __pow__(self, other: _E, modulo: _M, /) -> _T_co: ... |
| 1703 | +class _SupportsPow3(Protocol[_E_contra, _M_contra, _T_co]): |
| 1704 | + def __pow__(self, other: _E_contra, modulo: _M_contra, /) -> _T_co: ... |
1702 | 1705 |
|
1703 | 1706 | _SupportsSomeKindOfPow = ( # noqa: Y026 # TODO: Use TypeAlias once mypy bugs are fixed |
1704 | 1707 | _SupportsPow2[Any, Any] | _SupportsPow3NoneOnly[Any, Any] | _SupportsPow3[Any, Any, Any] |
@@ -1734,11 +1737,11 @@ def pow(base: float, exp: complex | _SupportsSomeKindOfPow, mod: None = None) -> |
1734 | 1737 | @overload |
1735 | 1738 | def pow(base: complex, exp: complex | _SupportsSomeKindOfPow, mod: None = None) -> complex: ... |
1736 | 1739 | @overload |
1737 | | -def pow(base: _SupportsPow2[_E, _T_co], exp: _E, mod: None = None) -> _T_co: ... # type: ignore[overload-overlap] |
| 1740 | +def pow(base: _SupportsPow2[_E_contra, _T_co], exp: _E_contra, mod: None = None) -> _T_co: ... # type: ignore[overload-overlap] |
1738 | 1741 | @overload |
1739 | | -def pow(base: _SupportsPow3NoneOnly[_E, _T_co], exp: _E, mod: None = None) -> _T_co: ... # type: ignore[overload-overlap] |
| 1742 | +def pow(base: _SupportsPow3NoneOnly[_E_contra, _T_co], exp: _E_contra, mod: None = None) -> _T_co: ... # type: ignore[overload-overlap] |
1740 | 1743 | @overload |
1741 | | -def pow(base: _SupportsPow3[_E, _M, _T_co], exp: _E, mod: _M) -> _T_co: ... |
| 1744 | +def pow(base: _SupportsPow3[_E_contra, _M_contra, _T_co], exp: _E_contra, mod: _M_contra) -> _T_co: ... |
1742 | 1745 | @overload |
1743 | 1746 | def pow(base: _SupportsSomeKindOfPow, exp: float, mod: None = None) -> Any: ... |
1744 | 1747 | @overload |
|
0 commit comments