Skip to content

Commit

Permalink
use a specific type ignore for .__hash__ reassignment
Browse files Browse the repository at this point in the history
  • Loading branch information
asottile committed Sep 28, 2024
1 parent ea70fd2 commit 8449e6e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions babi/highlight.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
Captures = Tuple[Tuple[int, 'Rule'], ...]


def uniquely_constructed(t: T) -> T:
def uniquely_constructed(t: type[T]) -> type[T]:
"""avoid tuple.__hash__ for "singleton" constructed objects"""
t.__hash__ = object.__hash__ # type: ignore
t.__hash__ = object.__hash__ # type: ignore[method-assign]
return t


Expand Down

0 comments on commit 8449e6e

Please sign in to comment.