Annotate known magic-method return types (#9131)

This commit is contained in:
Nikita Sobolev
2022-11-08 21:28:42 +03:00
committed by GitHub
parent c0e9038f0d
commit 62a6c3d616
87 changed files with 172 additions and 172 deletions

View File

@@ -4,8 +4,8 @@ class BaseRow:
def __init__(self, parent, processors, keymap, key_style, data) -> None: ...
def __reduce__(self): ...
def __iter__(self): ...
def __len__(self): ...
def __hash__(self): ...
def __len__(self) -> int: ...
def __hash__(self) -> int: ...
__getitem__: Any
def safe_rowproxy_reconstructor(__cls, __state): ...

View File

@@ -11,7 +11,7 @@ class ResultMetaData:
class RMKeyView(KeysView[Any]):
def __init__(self, parent) -> None: ...
def __len__(self): ...
def __len__(self) -> int: ...
def __iter__(self): ...
def __contains__(self, item): ...
def __eq__(self, other): ...

View File

@@ -41,7 +41,7 @@ RowProxy = Row
class ROMappingView(KeysView[Any], ValuesView[Any], ItemsView[Any, Any]):
def __init__(self, mapping, items) -> None: ...
def __len__(self): ...
def __len__(self) -> int: ...
def __iter__(self): ...
def __contains__(self, item): ...
def __eq__(self, other): ...
@@ -50,7 +50,7 @@ class ROMappingView(KeysView[Any], ValuesView[Any], ItemsView[Any, Any]):
class RowMapping(BaseRow, Mapping[Any, Any]):
__getitem__: Any
def __iter__(self): ...
def __len__(self): ...
def __len__(self) -> int: ...
def __contains__(self, key): ...
def items(self): ...
def keys(self): ...

View File

@@ -43,18 +43,18 @@ class _EmptyListener(_InstanceLevelDispatch):
remove: Any
clear: Any
def __call__(self, *args, **kw) -> None: ...
def __len__(self): ...
def __len__(self) -> int: ...
def __iter__(self): ...
def __bool__(self): ...
def __bool__(self) -> bool: ...
__nonzero__: Any
class _CompoundListener(_InstanceLevelDispatch):
def exec_once(self, *args, **kw) -> None: ...
def exec_once_unless_exception(self, *args, **kw) -> None: ...
def __call__(self, *args, **kw) -> None: ...
def __len__(self): ...
def __len__(self) -> int: ...
def __iter__(self): ...
def __bool__(self): ...
def __bool__(self) -> bool: ...
__nonzero__: Any
class _ListenerCollection(_CompoundListener):

View File

@@ -32,8 +32,8 @@ class AssociationProxy(interfaces.InspectionAttrInfo):
cascade_scalar_deletes: bool = ...,
) -> None: ...
def __get__(self, obj, class_): ...
def __set__(self, obj, values): ...
def __delete__(self, obj): ...
def __set__(self, obj, values) -> None: ...
def __delete__(self, obj) -> None: ...
def for_class(self, class_, obj: Any | None = ...): ...
class AssociationProxyInstance:
@@ -95,8 +95,8 @@ class _AssociationCollection:
def __init__(self, lazy_collection, creator, getter, setter, parent) -> None: ...
@property
def col(self): ...
def __len__(self): ...
def __bool__(self): ...
def __len__(self) -> int: ...
def __bool__(self) -> bool: ...
__nonzero__: Any
class _AssociationList(_AssociationCollection):
@@ -132,7 +132,7 @@ class _AssociationList(_AssociationCollection):
def __imul__(self, n): ...
def index(self, item, *args): ...
def copy(self): ...
def __hash__(self): ...
def __hash__(self) -> int: ...
class _AssociationDict(_AssociationCollection):
def __getitem__(self, key): ...
@@ -158,11 +158,11 @@ class _AssociationDict(_AssociationCollection):
def popitem(self): ...
def update(self, *a, **kw) -> None: ...
def copy(self): ...
def __hash__(self): ...
def __hash__(self) -> int: ...
class _AssociationSet(_AssociationCollection):
def __len__(self): ...
def __bool__(self): ...
def __len__(self) -> int: ...
def __bool__(self) -> bool: ...
__nonzero__: Any
def __contains__(self, value): ...
def __iter__(self): ...
@@ -196,4 +196,4 @@ class _AssociationSet(_AssociationCollection):
def __le__(self, other): ...
def __gt__(self, other): ...
def __ge__(self, other): ...
def __hash__(self): ...
def __hash__(self) -> int: ...

View File

@@ -11,6 +11,6 @@ class StartableContext(abc.ABC, metaclass=abc.ABCMeta):
async def __aexit__(self, type_, value, traceback): ...
class ProxyComparable(ReversibleProxy):
def __hash__(self): ...
def __hash__(self) -> int: ...
def __eq__(self, other): ...
def __ne__(self, other): ...

View File

@@ -207,7 +207,7 @@ class CollectionAttributeImpl(AttributeImpl):
def backref_listeners(attribute, key, uselist): ...
class History:
def __bool__(self): ...
def __bool__(self) -> bool: ...
__nonzero__: Any
def empty(self): ...
def sum(self): ...

View File

@@ -72,8 +72,8 @@ class CollectionAdapter:
def clear_with_event(self, initiator: Any | None = ...) -> None: ...
def clear_without_event(self) -> None: ...
def __iter__(self): ...
def __len__(self): ...
def __bool__(self): ...
def __len__(self) -> int: ...
def __bool__(self) -> bool: ...
__nonzero__: Any
def fire_append_wo_mutation_event(self, item, initiator: Any | None = ...): ...
def fire_append_event(self, item, initiator: Any | None = ...): ...

View File

@@ -49,8 +49,8 @@ class DynamicCollectionAdapter:
data: Any
def __init__(self, data) -> None: ...
def __iter__(self): ...
def __len__(self): ...
def __bool__(self): ...
def __len__(self) -> int: ...
def __bool__(self) -> bool: ...
__nonzero__: Any
class AppenderMixin:

View File

@@ -11,7 +11,7 @@ class IdentityMap:
def popitem(self) -> None: ...
def pop(self, key, *args) -> None: ...
def setdefault(self, key, default: Any | None = ...) -> None: ...
def __len__(self): ...
def __len__(self) -> int: ...
def copy(self) -> None: ...
def __setitem__(self, key, value) -> None: ...
def __delitem__(self, key) -> None: ...

View File

@@ -24,7 +24,7 @@ class ClassManager(HasMemoized, dict[Any, Any]):
local_attrs: Any
originals: Any
def __init__(self, class_) -> None: ...
def __hash__(self): ...
def __hash__(self) -> int: ... # type: ignore[override]
def __eq__(self, other): ...
@property
def is_mapped(self): ...
@@ -57,7 +57,7 @@ class ClassManager(HasMemoized, dict[Any, Any]):
def teardown_instance(self, instance) -> None: ...
def has_state(self, instance): ...
def has_parent(self, state, key, optimistic: bool = ...): ...
def __bool__(self): ...
def __bool__(self) -> bool: ...
__nonzero__: Any
class _SerializeManager:

View File

@@ -15,8 +15,8 @@ class PathRegistry(HasCacheKey):
def set(self, attributes, key, value) -> None: ...
def setdefault(self, attributes, key, value) -> None: ...
def get(self, attributes, key, value: Any | None = ...): ...
def __len__(self): ...
def __hash__(self): ...
def __len__(self) -> int: ...
def __hash__(self) -> int: ...
@property
def length(self): ...
def pairs(self) -> None: ...
@@ -93,7 +93,7 @@ class AbstractEntityRegistry(PathRegistry):
def entity_path(self): ...
@property
def mapper(self): ...
def __bool__(self): ...
def __bool__(self) -> bool: ...
__nonzero__: Any
def __getitem__(self, entity): ...

View File

@@ -10,7 +10,7 @@ class Annotated:
__dict__: Any
def __init__(self, element, values) -> None: ...
def __reduce__(self): ...
def __hash__(self): ...
def __hash__(self) -> int: ...
def __eq__(self, other): ...
@property
def entity_namespace(self): ...

View File

@@ -32,12 +32,12 @@ class _DialectArgView(MutableMapping[Any, Any]):
def __getitem__(self, key): ...
def __setitem__(self, key, value) -> None: ...
def __delitem__(self, key) -> None: ...
def __len__(self): ...
def __len__(self) -> int: ...
def __iter__(self): ...
class _DialectArgDict(MutableMapping[Any, Any]):
def __init__(self) -> None: ...
def __len__(self): ...
def __len__(self) -> int: ...
def __iter__(self): ...
def __getitem__(self, key): ...
def __setitem__(self, key, value) -> None: ...
@@ -119,8 +119,8 @@ class ColumnCollection:
def keys(self): ...
def values(self): ...
def items(self): ...
def __bool__(self): ...
def __len__(self): ...
def __bool__(self) -> bool: ...
def __len__(self) -> int: ...
def __iter__(self): ...
def __getitem__(self, key): ...
def __getattr__(self, key): ...
@@ -157,4 +157,4 @@ class ColumnSet(util.ordered_column_set[ColumnElement[Any]]):
def extend(self, cols) -> None: ...
def __add__(self, other): ...
def __eq__(self, other): ...
def __hash__(self): ...
def __hash__(self) -> int: ... # type: ignore[override]

View File

@@ -168,7 +168,7 @@ class ClauseList(roles.InElementRole, roles.OrderByRole, roles.ColumnsClauseRole
clauses: Any
def __init__(self, *clauses, **kwargs) -> None: ...
def __iter__(self): ...
def __len__(self): ...
def __len__(self) -> int: ...
def append(self, clause) -> None: ...
def self_group(self, against: Any | None = ...): ...

View File

@@ -106,7 +106,7 @@ class PyWrapper(ColumnOperators[_T], Generic[_T]):
def operate(self, op, *other, **kwargs): ...
def reverse_operate(self, op, other, **kwargs): ...
def __clause_element__(self): ...
def __bool__(self): ...
def __bool__(self) -> bool: ...
def __nonzero__(self): ...
def __getattribute__(self, key): ...
def __iter__(self): ...

View File

@@ -227,7 +227,7 @@ class ColumnCollectionConstraint(ColumnCollectionMixin, Constraint):
def copy(self, target_table: Any | None = ..., **kw): ...
def contains_column(self, col): ...
def __iter__(self): ...
def __len__(self): ...
def __len__(self) -> int: ...
class CheckConstraint(ColumnCollectionConstraint):
__visit_name__: str
@@ -318,7 +318,7 @@ class MetaData(SchemaItem):
naming_convention: Any | None = ...,
info: Any | None = ...,
) -> None: ...
def __contains__(self, table_or_key): ...
def __contains__(self, table_or_key) -> bool: ...
def is_bound(self): ...
bind: Any
def clear(self) -> None: ...

View File

@@ -175,7 +175,7 @@ class TableClause(roles.DMLTableRole, Immutable, FromClause):
class ForUpdateArg(ClauseElement):
def __eq__(self, other): ...
def __ne__(self, other): ...
def __hash__(self): ...
def __hash__(self) -> int: ...
nowait: Any
read: Any
skip_locked: Any

View File

@@ -22,7 +22,7 @@ class HasCacheKey:
class MemoizedHasCacheKey(HasCacheKey, HasMemoized): ...
class CacheKey:
def __hash__(self): ...
def __hash__(self) -> int: ...
def to_offline_string(self, statement_cache, statement, parameters): ...
def __eq__(self, other): ...

View File

@@ -6,4 +6,4 @@ class ComparableMixin:
def __eq__(self, other): ...
class ComparableEntity(ComparableMixin, BasicEntity):
def __hash__(self): ...
def __hash__(self) -> int: ...

View File

@@ -50,13 +50,13 @@ class BarWithoutCompare:
class NotComparable:
data: Any
def __init__(self, data) -> None: ...
def __hash__(self): ...
def __hash__(self) -> int: ...
def __eq__(self, other): ...
def __ne__(self, other): ...
class BrokenComparable:
data: Any
def __init__(self, data) -> None: ...
def __hash__(self): ...
def __hash__(self) -> int: ...
def __eq__(self, other): ...
def __ne__(self, other): ...

View File

@@ -136,7 +136,7 @@ class IdentitySet:
__copy__: Any
def __len__(self): ...
def __iter__(self): ...
def __hash__(self): ...
def __hash__(self) -> int: ...
class WeakSequence:
def __init__(self, __elements=...) -> None: ...