diff --git a/stubs/braintree/braintree/attribute_getter.pyi b/stubs/braintree/braintree/attribute_getter.pyi index 66998f5d8001..b38cb2a4816a 100644 --- a/stubs/braintree/braintree/attribute_getter.pyi +++ b/stubs/braintree/braintree/attribute_getter.pyi @@ -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: ... diff --git a/stubs/cffi/_cffi_backend.pyi b/stubs/cffi/_cffi_backend.pyi index b063e9bc8378..54e2cd0bb684 100644 --- a/stubs/cffi/_cffi_backend.pyi +++ b/stubs/cffi/_cffi_backend.pyi @@ -61,30 +61,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: diff --git a/stubs/gdb/gdb/__init__.pyi b/stubs/gdb/gdb/__init__.pyi index 45980500debc..2a6f1136571f 100644 --- a/stubs/gdb/gdb/__init__.pyi +++ b/stubs/gdb/gdb/__init__.pyi @@ -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") diff --git a/stubs/gevent/gevent/local.pyi b/stubs/gevent/gevent/local.pyi index cdcf88b483c8..1fe8911f581b 100644 --- a/stubs/gevent/gevent/local.pyi +++ b/stubs/gevent/gevent/local.pyi @@ -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"] diff --git a/stubs/hdbcli/hdbcli/resultrow.pyi b/stubs/hdbcli/hdbcli/resultrow.pyi index 8c3da3881017..26b6c37fc773 100644 --- a/stubs/hdbcli/hdbcli/resultrow.pyi +++ b/stubs/hdbcli/hdbcli/resultrow.pyi @@ -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 diff --git a/stubs/pika/pika/exchange_type.pyi b/stubs/pika/pika/exchange_type.pyi index ef55b20411f3..af625976ee47 100644 --- a/stubs/pika/pika/exchange_type.pyi +++ b/stubs/pika/pika/exchange_type.pyi @@ -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" diff --git a/stubs/protobuf/google/_upb/_message.pyi b/stubs/protobuf/google/_upb/_message.pyi index bb188bcbf4f1..dd741f8a034c 100644 --- a/stubs/protobuf/google/_upb/_message.pyi +++ b/stubs/protobuf/google/_upb/_message.pyi @@ -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 diff --git a/stubs/psycopg2/psycopg2/_psycopg.pyi b/stubs/psycopg2/psycopg2/_psycopg.pyi index abb744901c03..cebf454b460e 100644 --- a/stubs/psycopg2/psycopg2/_psycopg.pyi +++ b/stubs/psycopg2/psycopg2/_psycopg.pyi @@ -207,7 +207,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 @@ -275,7 +275,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): ... diff --git a/stubs/pywin32/_win32typing.pyi b/stubs/pywin32/_win32typing.pyi index 63777e1e05d5..3dd44c61c1e1 100644 --- a/stubs/pywin32/_win32typing.pyi +++ b/stubs/pywin32/_win32typing.pyi @@ -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: ... diff --git a/stubs/shapely/shapely/geometry/base.pyi b/stubs/shapely/shapely/geometry/base.pyi index 06daad1cff35..9a4a2d96a1b8 100644 --- a/stubs/shapely/shapely/geometry/base.pyi +++ b/stubs/shapely/shapely/geometry/base.pyi @@ -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: ... diff --git a/stubs/shapely/shapely/lib.pyi b/stubs/shapely/shapely/lib.pyi index a3b3d82bb9f2..33546b37d28c 100644 --- a/stubs/shapely/shapely/lib.pyi +++ b/stubs/shapely/shapely/lib.pyi @@ -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: