Annotate known magic-method return types (#9131)

This commit is contained in:
Nikita Sobolev
2022-11-08 18:28:42 +00:00
committed by GitHub
parent c0e9038f0d
commit 62a6c3d616
87 changed files with 172 additions and 172 deletions
+11 -11
View File
@@ -61,44 +61,44 @@ class Lib:
class _CDataBase:
__name__: ClassVar[str]
def __add__(self, other): ...
def __bool__(self): ...
def __bool__(self) -> bool: ...
def __call__(self, *args, **kwargs): ...
def __complex__(self): ...
def __delitem__(self, other): ...
def __complex__(self) -> complex: ...
def __delitem__(self, other) -> None: ...
def __dir__(self): ...
def __enter__(self): ...
def __eq__(self, other): ...
def __exit__(self, type, value, traceback): ...
def __float__(self): ...
def __float__(self) -> float: ...
def __ge__(self, other): ...
def __getitem__(self, index): ...
def __gt__(self, other): ...
def __hash__(self): ...
def __int__(self): ...
def __hash__(self) -> int: ...
def __int__(self) -> int: ...
def __iter__(self): ...
def __le__(self, other): ...
def __len__(self): ...
def __len__(self) -> int: ...
def __lt__(self, other): ...
def __ne__(self, other): ...
def __radd__(self, other): ...
def __rsub__(self, other): ...
def __setitem__(self, index, object): ...
def __setitem__(self, index, object) -> None: ...
def __sub__(self, other): ...
@final
class buffer:
__hash__: ClassVar[None] # type: ignore[assignment]
def __init__(self, *args, **kwargs) -> None: ...
def __delitem__(self, other): ...
def __delitem__(self, other) -> None: ...
def __eq__(self, other): ...
def __ge__(self, other): ...
def __getitem__(self, index): ...
def __gt__(self, other): ...
def __le__(self, other): ...
def __len__(self): ...
def __len__(self) -> int: ...
def __lt__(self, other): ...
def __ne__(self, other): ...
def __setitem__(self, index, object): ...
def __setitem__(self, index, object) -> None: ...
# These aliases are to work around pyright complaints.
# Pyright doesn't like it when a class object is defined as an alias
+2 -2
View File
@@ -18,11 +18,11 @@ class CTypesData:
def __le__(self, other): ...
def __gt__(self, other): ...
def __ge__(self, other): ...
def __hash__(self): ...
def __hash__(self) -> int: ...
def __repr__(self, c_name: str | None = ...): ...
class CTypesGenericPrimitive(CTypesData):
def __hash__(self): ...
def __hash__(self) -> int: ...
class CTypesGenericArray(CTypesData):
def __iter__(self): ...
+1 -1
View File
@@ -21,7 +21,7 @@ class BaseTypeByIdentity:
class BaseType(BaseTypeByIdentity):
def __eq__(self, other): ...
def __ne__(self, other): ...
def __hash__(self): ...
def __hash__(self) -> int: ...
class VoidType(BaseType):
c_name_with_marker: str