From 8449e6e8d7c1c62509de9b1074aff95527724746 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sat, 28 Sep 2024 14:11:16 -0400 Subject: [PATCH] use a specific type ignore for .__hash__ reassignment --- babi/highlight.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/babi/highlight.py b/babi/highlight.py index 50d0bcd..f09a348 100644 --- a/babi/highlight.py +++ b/babi/highlight.py @@ -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