mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-06 21:43:59 +08:00
Mark various dunder methods as positional-only in the stdlib (#14528)
This commit is contained in:
@@ -39,7 +39,7 @@ class Token(Generic[_T]):
|
||||
if sys.version_info >= (3, 14):
|
||||
def __enter__(self) -> Self: ...
|
||||
def __exit__(
|
||||
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None
|
||||
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None, /
|
||||
) -> None: ...
|
||||
|
||||
def copy_context() -> Context: ...
|
||||
|
||||
@@ -17,15 +17,15 @@ class ChannelID:
|
||||
def send(self) -> Self: ...
|
||||
@property
|
||||
def recv(self) -> Self: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __ge__(self, other: ChannelID) -> bool: ...
|
||||
def __gt__(self, other: ChannelID) -> bool: ...
|
||||
def __eq__(self, other: object, /) -> bool: ...
|
||||
def __ge__(self, other: ChannelID, /) -> bool: ...
|
||||
def __gt__(self, other: ChannelID, /) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __index__(self) -> int: ...
|
||||
def __int__(self) -> int: ...
|
||||
def __le__(self, other: ChannelID) -> bool: ...
|
||||
def __lt__(self, other: ChannelID) -> bool: ...
|
||||
def __ne__(self, other: object) -> bool: ...
|
||||
def __le__(self, other: ChannelID, /) -> bool: ...
|
||||
def __lt__(self, other: ChannelID, /) -> bool: ...
|
||||
def __ne__(self, other: object, /) -> bool: ...
|
||||
|
||||
@final
|
||||
class ChannelInfo(structseq[int], tuple[bool, bool, bool, int, int, int, int, int]):
|
||||
|
||||
@@ -58,6 +58,7 @@ class array(MutableSequence[_T]):
|
||||
def tounicode(self) -> str: ...
|
||||
|
||||
__hash__: ClassVar[None] # type: ignore[assignment]
|
||||
def __contains__(self, value: object, /) -> bool: ...
|
||||
def __len__(self) -> int: ...
|
||||
@overload
|
||||
def __getitem__(self, key: SupportsIndex, /) -> _T: ...
|
||||
|
||||
@@ -89,8 +89,8 @@ class EntryPoint(_EntryPointBase):
|
||||
) -> bool: ... # undocumented
|
||||
|
||||
def __hash__(self) -> int: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
if sys.version_info >= (3, 11):
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __lt__(self, other: object) -> bool: ...
|
||||
if sys.version_info < (3, 12):
|
||||
def __iter__(self) -> Iterator[Any]: ... # result of iter((str, Self)), really
|
||||
|
||||
+15
-15
@@ -207,12 +207,12 @@ class TypeVar:
|
||||
contravariant: bool = False,
|
||||
) -> None: ...
|
||||
if sys.version_info >= (3, 10):
|
||||
def __or__(self, right: Any) -> _SpecialForm: ... # AnnotationForm
|
||||
def __ror__(self, left: Any) -> _SpecialForm: ... # AnnotationForm
|
||||
def __or__(self, right: Any, /) -> _SpecialForm: ... # AnnotationForm
|
||||
def __ror__(self, left: Any, /) -> _SpecialForm: ... # AnnotationForm
|
||||
if sys.version_info >= (3, 11):
|
||||
def __typing_subst__(self, arg: Any) -> Any: ...
|
||||
def __typing_subst__(self, arg: Any, /) -> Any: ...
|
||||
if sys.version_info >= (3, 13):
|
||||
def __typing_prepare_subst__(self, alias: Any, args: Any) -> tuple[Any, ...]: ...
|
||||
def __typing_prepare_subst__(self, alias: Any, args: Any, /) -> tuple[Any, ...]: ...
|
||||
def has_default(self) -> bool: ...
|
||||
if sys.version_info >= (3, 14):
|
||||
@property
|
||||
@@ -273,8 +273,8 @@ if sys.version_info >= (3, 11):
|
||||
def __init__(self, name: str) -> None: ...
|
||||
|
||||
def __iter__(self) -> Any: ...
|
||||
def __typing_subst__(self, arg: Never) -> Never: ...
|
||||
def __typing_prepare_subst__(self, alias: Any, args: Any) -> tuple[Any, ...]: ...
|
||||
def __typing_subst__(self, arg: Never, /) -> Never: ...
|
||||
def __typing_prepare_subst__(self, alias: Any, args: Any, /) -> tuple[Any, ...]: ...
|
||||
if sys.version_info >= (3, 14):
|
||||
@property
|
||||
def evaluate_default(self) -> EvaluateFunc | None: ...
|
||||
@@ -289,7 +289,7 @@ if sys.version_info >= (3, 10):
|
||||
else:
|
||||
def __init__(self, origin: ParamSpec) -> None: ...
|
||||
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __eq__(self, other: object, /) -> bool: ...
|
||||
__hash__: ClassVar[None] # type: ignore[assignment]
|
||||
|
||||
@final
|
||||
@@ -301,7 +301,7 @@ if sys.version_info >= (3, 10):
|
||||
else:
|
||||
def __init__(self, origin: ParamSpec) -> None: ...
|
||||
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __eq__(self, other: object, /) -> bool: ...
|
||||
__hash__: ClassVar[None] # type: ignore[assignment]
|
||||
|
||||
@final
|
||||
@@ -365,11 +365,11 @@ if sys.version_info >= (3, 10):
|
||||
@property
|
||||
def kwargs(self) -> ParamSpecKwargs: ...
|
||||
if sys.version_info >= (3, 11):
|
||||
def __typing_subst__(self, arg: Any) -> Any: ...
|
||||
def __typing_prepare_subst__(self, alias: Any, args: Any) -> tuple[Any, ...]: ...
|
||||
def __typing_subst__(self, arg: Any, /) -> Any: ...
|
||||
def __typing_prepare_subst__(self, alias: Any, args: Any, /) -> tuple[Any, ...]: ...
|
||||
|
||||
def __or__(self, right: Any) -> _SpecialForm: ...
|
||||
def __ror__(self, left: Any) -> _SpecialForm: ...
|
||||
def __or__(self, right: Any, /) -> _SpecialForm: ...
|
||||
def __ror__(self, left: Any, /) -> _SpecialForm: ...
|
||||
if sys.version_info >= (3, 13):
|
||||
def has_default(self) -> bool: ...
|
||||
if sys.version_info >= (3, 14):
|
||||
@@ -1115,9 +1115,9 @@ if sys.version_info >= (3, 12):
|
||||
# It's writable on types, but not on instances of TypeAliasType.
|
||||
@property
|
||||
def __module__(self) -> str | None: ... # type: ignore[override]
|
||||
def __getitem__(self, parameters: Any) -> GenericAlias: ... # AnnotationForm
|
||||
def __or__(self, right: Any) -> _SpecialForm: ...
|
||||
def __ror__(self, left: Any) -> _SpecialForm: ...
|
||||
def __getitem__(self, parameters: Any, /) -> GenericAlias: ... # AnnotationForm
|
||||
def __or__(self, right: Any, /) -> _SpecialForm: ...
|
||||
def __ror__(self, left: Any, /) -> _SpecialForm: ...
|
||||
if sys.version_info >= (3, 14):
|
||||
@property
|
||||
def evaluate_value(self) -> EvaluateFunc: ...
|
||||
|
||||
@@ -593,8 +593,8 @@ else:
|
||||
def __getitem__(self, parameters: Incomplete | tuple[Incomplete, ...]) -> AnnotationForm: ...
|
||||
def __init_subclass__(cls, *args: Unused, **kwargs: Unused) -> NoReturn: ...
|
||||
if sys.version_info >= (3, 10):
|
||||
def __or__(self, right: Any) -> _SpecialForm: ...
|
||||
def __ror__(self, left: Any) -> _SpecialForm: ...
|
||||
def __or__(self, right: Any, /) -> _SpecialForm: ...
|
||||
def __ror__(self, left: Any, /) -> _SpecialForm: ...
|
||||
|
||||
# PEP 727
|
||||
class Doc:
|
||||
|
||||
+1
-1
@@ -123,7 +123,7 @@ if sys.platform == "win32":
|
||||
def __int__(self) -> int: ...
|
||||
def __enter__(self) -> Self: ...
|
||||
def __exit__(
|
||||
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None
|
||||
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None, /
|
||||
) -> bool | None: ...
|
||||
def Close(self) -> None: ...
|
||||
def Detach(self) -> int: ...
|
||||
|
||||
Reference in New Issue
Block a user