mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Improve several __hash__ methods (#8128)
This commit is contained in:
@@ -19,7 +19,7 @@ class Row(BaseRow, Sequence[Any], metaclass=abc.ABCMeta):
|
||||
@property
|
||||
def index(self): ...
|
||||
def __contains__(self, key): ...
|
||||
__hash__: Any
|
||||
__hash__ = BaseRow.__hash__
|
||||
def __lt__(self, other): ...
|
||||
def __le__(self, other): ...
|
||||
def __ge__(self, other): ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Generic, TypeVar
|
||||
from typing import Any, ClassVar, Generic, TypeVar
|
||||
|
||||
from ..sql.operators import ColumnOperators
|
||||
from ..util import memoized_property
|
||||
@@ -37,7 +37,7 @@ class CompositeProperty(DescriptorProperty):
|
||||
def create_row_processor(self, query, procs, labels): ...
|
||||
|
||||
class Comparator(PropComparator[_T], Generic[_T]):
|
||||
__hash__: Any
|
||||
__hash__: ClassVar[None] # type: ignore[assignment]
|
||||
@memoized_property
|
||||
def clauses(self): ...
|
||||
def __clause_element__(self): ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Generic, TypeVar
|
||||
from typing import Any, ClassVar, Generic, TypeVar
|
||||
|
||||
from ..sql.operators import ColumnOperators
|
||||
from ..util import memoized_property
|
||||
@@ -101,7 +101,7 @@ class RelationshipProperty(StrategizedProperty):
|
||||
def of_type(self, cls): ...
|
||||
def and_(self, *other): ...
|
||||
def in_(self, other) -> ColumnOperators[_T]: ...
|
||||
__hash__: Any
|
||||
__hash__: ClassVar[None] # type: ignore[assignment]
|
||||
def __eq__(self, other): ...
|
||||
def any(self, criterion: Any | None = ..., **kwargs): ...
|
||||
def has(self, criterion: Any | None = ..., **kwargs): ...
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from _typeshed import Self
|
||||
from collections.abc import MutableMapping
|
||||
from typing import Any
|
||||
from typing import Any, ClassVar
|
||||
|
||||
from .. import util
|
||||
from ..util import HasMemoized, hybridmethod, memoized_property
|
||||
@@ -133,7 +133,7 @@ class ColumnCollection:
|
||||
def clear(self) -> None: ...
|
||||
def remove(self, column) -> None: ...
|
||||
def update(self, iter_) -> None: ...
|
||||
__hash__: Any
|
||||
__hash__: ClassVar[None] # type: ignore[assignment]
|
||||
def add(self, column, key: Any | None = ...) -> None: ...
|
||||
def contains_column(self, col): ...
|
||||
def as_immutable(self): ...
|
||||
|
||||
@@ -21,14 +21,14 @@ class Foo:
|
||||
stuff: Any
|
||||
moredata: Any
|
||||
def __init__(self, moredata, stuff: str = ...) -> None: ...
|
||||
__hash__: Any
|
||||
__hash__ = object.__hash__
|
||||
def __eq__(self, other): ...
|
||||
|
||||
class Bar:
|
||||
x: Any
|
||||
y: Any
|
||||
def __init__(self, x, y) -> None: ...
|
||||
__hash__: Any
|
||||
__hash__ = object.__hash__
|
||||
def __eq__(self, other): ...
|
||||
|
||||
class OldSchool:
|
||||
|
||||
Reference in New Issue
Block a user