Skip to content

Commit

Permalink
Merge pull request #354 from asottile/specific-ignore
Browse files Browse the repository at this point in the history
use a specific type ignore for .__hash__ reassignment
  • Loading branch information
asottile authored Sep 28, 2024
2 parents 77bf4d5 + 8449e6e commit f397186
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 f397186

Please sign in to comment.