Skip to content

Commit d71cd0e

Browse files
authored
Add ColumnOperators.__hash__ (fixes #262) (#263)
1 parent 9a115e2 commit d71cd0e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sqlalchemy-stubs/sql/operators.pyi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ class ColumnOperators(Operators[ColumnElement[_TE]], Generic[_TE]):
111111
def __lt__(self, other: Any) -> ColumnElement[sqltypes.Boolean]: ...
112112
def __le__(self, other: Any) -> ColumnElement[sqltypes.Boolean]: ...
113113
def __eq__(self, other: Any) -> ColumnElement[sqltypes.Boolean]: ... # type: ignore[override]
114+
# ColumnOperators defines an __eq__ so it must explicitly declare also
115+
# an hash or it's set to None by python:
116+
# https://docs.python.org/3/reference/datamodel.html#object.__hash__
117+
def __hash__(self) -> int: ...
114118
def __ne__(self, other: Any) -> ColumnElement[sqltypes.Boolean]: ... # type: ignore[override]
115119
def is_distinct_from(
116120
self, other: Any

0 commit comments

Comments
 (0)