Simplify Unhashable sentinel implementation

This commit is contained in:
xmarre 2026-03-14 12:42:04 +01:00
parent 17863f603a
commit 2bea0ee5d7

View File

@ -56,10 +56,8 @@ class CacheKeySet(ABC):
return self.subcache_keys.get(node_id, None)
class Unhashable:
"""Hashable sentinel for values that cannot be represented safely in cache keys."""
def __init__(self):
"""Initialize a sentinel that stays hashable while never comparing equal."""
self.value = float("NaN")
"""Hashable identity sentinel for values that cannot be represented safely in cache keys."""
pass
def _sanitized_sort_key(obj, depth=0, max_depth=32):