mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-09 06:46:18 +08:00
Fix dunder-method positional-only parameter discrepancies in third-party stubs (#14529)
This commit is contained in:
@@ -4,4 +4,4 @@ class AttributeGetter:
|
||||
def __init__(self, attributes: dict[str, Any] | None = None) -> None: ...
|
||||
# This doesn't exist at runtime, but subclasses should define their own fields populated by attributes in __init__
|
||||
# Until that's done, keep __getattribute__ to fill in the gaps
|
||||
def __getattribute__(self, name: str) -> Any: ...
|
||||
def __getattribute__(self, name: str, /) -> Any: ...
|
||||
|
||||
@@ -62,30 +62,32 @@ class Lib:
|
||||
@final
|
||||
class _CDataBase:
|
||||
__name__: ClassVar[str]
|
||||
def __add__(self, other): ...
|
||||
def __add__(self, other, /): ...
|
||||
def __bool__(self) -> bool: ...
|
||||
def __call__(self, *args, **kwargs): ...
|
||||
def __complex__(self) -> complex: ...
|
||||
def __delitem__(self, other) -> None: ...
|
||||
def __delitem__(self, other, /) -> None: ...
|
||||
def __dir__(self): ...
|
||||
def __enter__(self): ...
|
||||
def __eq__(self, other): ...
|
||||
def __exit__(self, type: type[BaseException] | None, value: BaseException | None, traceback: types.TracebackType | None): ...
|
||||
def __eq__(self, other, /): ...
|
||||
def __exit__(
|
||||
self, type: type[BaseException] | None, value: BaseException | None, traceback: types.TracebackType | None, /
|
||||
): ...
|
||||
def __float__(self) -> float: ...
|
||||
def __ge__(self, other): ...
|
||||
def __getitem__(self, index: SupportsIndex | slice): ...
|
||||
def __gt__(self, other): ...
|
||||
def __ge__(self, other, /): ...
|
||||
def __getitem__(self, index: SupportsIndex | slice, /): ...
|
||||
def __gt__(self, other, /): ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __int__(self) -> int: ...
|
||||
def __iter__(self): ...
|
||||
def __le__(self, other): ...
|
||||
def __le__(self, other, /): ...
|
||||
def __len__(self) -> int: ...
|
||||
def __lt__(self, other): ...
|
||||
def __ne__(self, other): ...
|
||||
def __radd__(self, other): ...
|
||||
def __rsub__(self, other): ...
|
||||
def __setitem__(self, index: SupportsIndex | slice, object) -> None: ...
|
||||
def __sub__(self, other): ...
|
||||
def __lt__(self, other, /): ...
|
||||
def __ne__(self, other, /): ...
|
||||
def __radd__(self, other, /): ...
|
||||
def __rsub__(self, other, /): ...
|
||||
def __setitem__(self, index: SupportsIndex | slice, object, /) -> None: ...
|
||||
def __sub__(self, other, /): ...
|
||||
|
||||
@final
|
||||
class buffer:
|
||||
|
||||
+24
-24
@@ -83,29 +83,29 @@ class Value:
|
||||
def __index__(self) -> int: ...
|
||||
def __int__(self) -> int: ...
|
||||
def __float__(self) -> float: ...
|
||||
def __add__(self, other: _ValueOrNative) -> Value: ...
|
||||
def __radd__(self, other: _ValueOrNative) -> Value: ...
|
||||
def __sub__(self, other: _ValueOrNative) -> Value: ...
|
||||
def __rsub__(self, other: _ValueOrNative) -> Value: ...
|
||||
def __mul__(self, other: _ValueOrNative) -> Value: ...
|
||||
def __rmul__(self, other: _ValueOrNative) -> Value: ...
|
||||
def __truediv__(self, other: _ValueOrNative) -> Value: ...
|
||||
def __rtruediv__(self, other: _ValueOrNative) -> Value: ...
|
||||
def __mod__(self, other: _ValueOrNative) -> Value: ...
|
||||
def __rmod__(self, other: _ValueOrNative) -> Value: ...
|
||||
def __pow__(self, other: _ValueOrNative, mod: None = None) -> Value: ...
|
||||
def __and__(self, other: _ValueOrNative) -> Value: ...
|
||||
def __or__(self, other: _ValueOrNative) -> Value: ...
|
||||
def __xor__(self, other: _ValueOrNative) -> Value: ...
|
||||
def __lshift__(self, other: _ValueOrNative) -> Value: ...
|
||||
def __rshift__(self, other: _ValueOrNative) -> Value: ...
|
||||
def __eq__(self, other: _ValueOrNative) -> bool: ... # type: ignore[override]
|
||||
def __ne__(self, other: _ValueOrNative) -> bool: ... # type: ignore[override]
|
||||
def __lt__(self, other: _ValueOrNative) -> bool: ...
|
||||
def __le__(self, other: _ValueOrNative) -> bool: ...
|
||||
def __gt__(self, other: _ValueOrNative) -> bool: ...
|
||||
def __ge__(self, other: _ValueOrNative) -> bool: ...
|
||||
def __getitem__(self, key: int | str | Field) -> Value: ...
|
||||
def __add__(self, other: _ValueOrNative, /) -> Value: ...
|
||||
def __radd__(self, other: _ValueOrNative, /) -> Value: ...
|
||||
def __sub__(self, other: _ValueOrNative, /) -> Value: ...
|
||||
def __rsub__(self, other: _ValueOrNative, /) -> Value: ...
|
||||
def __mul__(self, other: _ValueOrNative, /) -> Value: ...
|
||||
def __rmul__(self, other: _ValueOrNative, /) -> Value: ...
|
||||
def __truediv__(self, other: _ValueOrNative, /) -> Value: ...
|
||||
def __rtruediv__(self, other: _ValueOrNative, /) -> Value: ...
|
||||
def __mod__(self, other: _ValueOrNative, /) -> Value: ...
|
||||
def __rmod__(self, other: _ValueOrNative, /) -> Value: ...
|
||||
def __pow__(self, other: _ValueOrNative, mod: None = None, /) -> Value: ...
|
||||
def __and__(self, other: _ValueOrNative, /) -> Value: ...
|
||||
def __or__(self, other: _ValueOrNative, /) -> Value: ...
|
||||
def __xor__(self, other: _ValueOrNative, /) -> Value: ...
|
||||
def __lshift__(self, other: _ValueOrNative, /) -> Value: ...
|
||||
def __rshift__(self, other: _ValueOrNative, /) -> Value: ...
|
||||
def __eq__(self, other: _ValueOrNative, /) -> bool: ... # type: ignore[override]
|
||||
def __ne__(self, other: _ValueOrNative, /) -> bool: ... # type: ignore[override]
|
||||
def __lt__(self, other: _ValueOrNative, /) -> bool: ...
|
||||
def __le__(self, other: _ValueOrNative, /) -> bool: ...
|
||||
def __gt__(self, other: _ValueOrNative, /) -> bool: ...
|
||||
def __ge__(self, other: _ValueOrNative, /) -> bool: ...
|
||||
def __getitem__(self, key: int | str | Field, /) -> Value: ...
|
||||
def __call__(self, *args: _ValueOrNative) -> Value: ...
|
||||
def __init__(self, val: _ValueOrNative) -> None: ...
|
||||
def cast(self, type: Type) -> Value: ...
|
||||
@@ -175,7 +175,7 @@ class Type(Mapping[str, Field]):
|
||||
def get(self, key: str, default: Any = ...) -> Field | Any: ...
|
||||
def has_key(self, key: str) -> bool: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __getitem__(self, key: str) -> Field: ...
|
||||
def __getitem__(self, key: str, /) -> Field: ...
|
||||
def __iter__(self) -> TypeIterator[str]: ...
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
@@ -4,8 +4,8 @@ from typing_extensions import Self
|
||||
class local:
|
||||
def __init__(self, *args: object, **kwargs: object) -> None: ...
|
||||
def __copy__(self) -> Self: ...
|
||||
def __getattribute__(self, name: str) -> Any: ...
|
||||
def __delattr__(self, name: str) -> None: ...
|
||||
def __setattr__(self, name: str, value: Any) -> None: ...
|
||||
def __getattribute__(self, name: str, /) -> Any: ...
|
||||
def __delattr__(self, name: str, /) -> None: ...
|
||||
def __setattr__(self, name: str, value: Any, /) -> None: ...
|
||||
|
||||
__all__ = ["local"]
|
||||
|
||||
@@ -8,8 +8,8 @@ class ResultRow:
|
||||
|
||||
def __len__(self) -> int: ...
|
||||
@overload
|
||||
def __getitem__(self, index: int) -> Any: ...
|
||||
def __getitem__(self, index: int, /) -> Any: ...
|
||||
@overload
|
||||
def __getitem__(self, index: slice) -> Sequence[Any]: ...
|
||||
def __getitem__(self, index: slice, /) -> Sequence[Any]: ...
|
||||
def __iter__(self) -> Iterator[Any]: ...
|
||||
# __next__, __delitem__, __setitem__ are technically defined but lead always to an error
|
||||
|
||||
@@ -1,7 +1,19 @@
|
||||
from enum import Enum
|
||||
import sys
|
||||
|
||||
class ExchangeType(Enum):
|
||||
direct = "direct"
|
||||
fanout = "fanout"
|
||||
headers = "headers"
|
||||
topic = "topic"
|
||||
if sys.version_info >= (3, 11):
|
||||
from enum import StrEnum
|
||||
|
||||
class ExchangeType(StrEnum):
|
||||
direct = "direct"
|
||||
fanout = "fanout"
|
||||
headers = "headers"
|
||||
topic = "topic"
|
||||
|
||||
else:
|
||||
from enum import Enum
|
||||
|
||||
class ExchangeType(str, Enum):
|
||||
direct = "direct"
|
||||
fanout = "fanout"
|
||||
headers = "headers"
|
||||
topic = "topic"
|
||||
|
||||
@@ -78,18 +78,18 @@ class EnumValueDescriptor:
|
||||
|
||||
@final
|
||||
class ExtensionDict:
|
||||
def __contains__(self, other) -> bool: ...
|
||||
def __delitem__(self, other) -> None: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __ge__(self, other: object) -> bool: ...
|
||||
def __getitem__(self, index): ...
|
||||
def __gt__(self, other: object) -> bool: ...
|
||||
def __contains__(self, other, /) -> bool: ...
|
||||
def __delitem__(self, other, /) -> None: ...
|
||||
def __eq__(self, other: object, /) -> bool: ...
|
||||
def __ge__(self, other: object, /) -> bool: ...
|
||||
def __getitem__(self, index, /): ...
|
||||
def __gt__(self, other: object, /) -> bool: ...
|
||||
def __iter__(self): ...
|
||||
def __le__(self, other: object) -> bool: ...
|
||||
def __le__(self, other: object, /) -> bool: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __lt__(self, other: object) -> bool: ...
|
||||
def __ne__(self, other: object) -> bool: ...
|
||||
def __setitem__(self, index, object) -> None: ...
|
||||
def __lt__(self, other: object, /) -> bool: ...
|
||||
def __ne__(self, other: object, /) -> bool: ...
|
||||
def __setitem__(self, index, object, /) -> None: ...
|
||||
|
||||
@final
|
||||
class ExtensionIterator:
|
||||
@@ -201,16 +201,16 @@ class Message:
|
||||
def SetInParent(self): ...
|
||||
def UnknownFields(self): ...
|
||||
def WhichOneof(self, object, /): ...
|
||||
def __contains__(self, other) -> bool: ...
|
||||
def __contains__(self, other, /) -> bool: ...
|
||||
def __deepcopy__(self, memo=None): ...
|
||||
def __delattr__(self, name): ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __ge__(self, other: object) -> bool: ...
|
||||
def __gt__(self, other: object) -> bool: ...
|
||||
def __le__(self, other: object) -> bool: ...
|
||||
def __lt__(self, other: object) -> bool: ...
|
||||
def __ne__(self, other: object) -> bool: ...
|
||||
def __setattr__(self, name, value): ...
|
||||
def __delattr__(self, name, /): ...
|
||||
def __eq__(self, other: object, /) -> bool: ...
|
||||
def __ge__(self, other: object, /) -> bool: ...
|
||||
def __gt__(self, other: object, /) -> bool: ...
|
||||
def __le__(self, other: object, /) -> bool: ...
|
||||
def __lt__(self, other: object, /) -> bool: ...
|
||||
def __ne__(self, other: object, /) -> bool: ...
|
||||
def __setattr__(self, name, value, /): ...
|
||||
|
||||
@final
|
||||
class MessageMeta(type): ...
|
||||
@@ -253,16 +253,16 @@ class RepeatedCompositeContainer:
|
||||
def reverse(self): ...
|
||||
def sort(self, *args, **kwargs): ... # incomplete
|
||||
def __deepcopy__(self, memo=None): ...
|
||||
def __delitem__(self, other) -> None: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __ge__(self, other: object) -> bool: ...
|
||||
def __getitem__(self, index): ...
|
||||
def __gt__(self, other: object) -> bool: ...
|
||||
def __le__(self, other: object) -> bool: ...
|
||||
def __delitem__(self, other, /) -> None: ...
|
||||
def __eq__(self, other: object, /) -> bool: ...
|
||||
def __ge__(self, other: object, /) -> bool: ...
|
||||
def __getitem__(self, index, /): ...
|
||||
def __gt__(self, other: object, /) -> bool: ...
|
||||
def __le__(self, other: object, /) -> bool: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __lt__(self, other: object) -> bool: ...
|
||||
def __ne__(self, other: object) -> bool: ...
|
||||
def __setitem__(self, index, object) -> None: ...
|
||||
def __lt__(self, other: object, /) -> bool: ...
|
||||
def __ne__(self, other: object, /) -> bool: ...
|
||||
def __setitem__(self, index, object, /) -> None: ...
|
||||
|
||||
@final
|
||||
class RepeatedScalarContainer:
|
||||
@@ -276,17 +276,17 @@ class RepeatedScalarContainer:
|
||||
def reverse(self): ...
|
||||
def sort(self, *args, **kwargs): ... # incomplete
|
||||
def __deepcopy__(self, memo=None): ...
|
||||
def __delitem__(self, other) -> None: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __ge__(self, other: object) -> bool: ...
|
||||
def __getitem__(self, index): ...
|
||||
def __gt__(self, other: object) -> bool: ...
|
||||
def __le__(self, other: object) -> bool: ...
|
||||
def __delitem__(self, other, /) -> None: ...
|
||||
def __eq__(self, other: object, /) -> bool: ...
|
||||
def __ge__(self, other: object, /) -> bool: ...
|
||||
def __getitem__(self, index, /): ...
|
||||
def __gt__(self, other: object, /) -> bool: ...
|
||||
def __le__(self, other: object, /) -> bool: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __lt__(self, other: object) -> bool: ...
|
||||
def __ne__(self, other: object) -> bool: ...
|
||||
def __lt__(self, other: object, /) -> bool: ...
|
||||
def __ne__(self, other: object, /) -> bool: ...
|
||||
def __reduce__(self): ...
|
||||
def __setitem__(self, index, object) -> None: ...
|
||||
def __setitem__(self, index, object, /) -> None: ...
|
||||
|
||||
@final
|
||||
class ServiceDescriptor:
|
||||
@@ -304,7 +304,7 @@ class ServiceDescriptor:
|
||||
@final
|
||||
class UnknownFieldSet:
|
||||
def __init__(self, *args, **kwargs) -> None: ... # incomplete
|
||||
def __getitem__(self, index): ...
|
||||
def __getitem__(self, index, /): ...
|
||||
def __len__(self) -> int: ...
|
||||
|
||||
def SetAllowOversizeProtos(object, /): ... # incomplete
|
||||
|
||||
@@ -209,7 +209,7 @@ class Column:
|
||||
def __len__(self) -> int: ...
|
||||
def __lt__(self, other, /): ...
|
||||
def __ne__(self, other, /): ...
|
||||
def __setstate__(self, state): ...
|
||||
def __setstate__(self, state, /): ...
|
||||
|
||||
class ConnectionInfo:
|
||||
# Note: the following properties can be None if their corresponding libpq function
|
||||
@@ -277,7 +277,7 @@ class Error(Exception):
|
||||
pgerror: str | None
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
def __reduce__(self): ...
|
||||
def __setstate__(self, state): ...
|
||||
def __setstate__(self, state, /): ...
|
||||
|
||||
class DatabaseError(Error): ...
|
||||
class DataError(DatabaseError): ...
|
||||
|
||||
@@ -1667,7 +1667,7 @@ class PySecBufferDesc:
|
||||
Version: Incomplete
|
||||
Buffer: Incomplete
|
||||
def append(self, buffer, /) -> None: ...
|
||||
def __getitem__(self, index: SupportsIndex) -> PySecBuffer: ...
|
||||
def __getitem__(self, index: SupportsIndex, /) -> PySecBuffer: ...
|
||||
|
||||
class PyTOKEN_GROUPS: ...
|
||||
class PyTOKEN_PRIVILEGES: ...
|
||||
|
||||
@@ -63,8 +63,8 @@ class BaseGeometry(Geometry):
|
||||
def __xor__(self, other: OptGeoArrayLikeSeq) -> GeoArray: ...
|
||||
@overload
|
||||
def __xor__(self, other: None) -> None: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __ne__(self, other: object) -> bool: ...
|
||||
def __eq__(self, other: object, /) -> bool: ...
|
||||
def __ne__(self, other: object, /) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
@property
|
||||
def coords(self) -> CoordinateSequence: ...
|
||||
|
||||
@@ -144,12 +144,12 @@ registry: list[type[Geometry]]
|
||||
|
||||
class Geometry:
|
||||
def __hash__(self) -> int: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __ne__(self, other: object) -> bool: ...
|
||||
def __ge__(self, other: Never) -> bool: ...
|
||||
def __gt__(self, other: Never) -> bool: ...
|
||||
def __le__(self, other: Never) -> bool: ...
|
||||
def __lt__(self, other: Never) -> bool: ...
|
||||
def __eq__(self, other: object, /) -> bool: ...
|
||||
def __ne__(self, other: object, /) -> bool: ...
|
||||
def __ge__(self, other: Never, /) -> bool: ...
|
||||
def __gt__(self, other: Never, /) -> bool: ...
|
||||
def __le__(self, other: Never, /) -> bool: ...
|
||||
def __lt__(self, other: Never, /) -> bool: ...
|
||||
|
||||
@final
|
||||
class STRtree:
|
||||
|
||||
Reference in New Issue
Block a user