Add missing docstrings

This commit is contained in:
xmarre 2026-03-14 09:57:22 +01:00
parent 880b51ac4f
commit 4b431ffc27
2 changed files with 4 additions and 0 deletions

View File

@ -47,6 +47,8 @@ class CacheKeySet(ABC):
return self.subcache_keys.get(node_id, None)
class Unhashable:
"""Hashable sentinel used when an input cannot be safely represented."""
def __init__(self):
"""Create a hashable sentinel value for unhashable prompt inputs."""
self.value = float("NaN")

View File

@ -2,6 +2,7 @@ from comfy_execution.caching import Unhashable, to_hashable
def test_to_hashable_returns_unhashable_for_cyclic_builtin_containers():
"""Ensure self-referential built-in containers terminate as Unhashable."""
cyclic_list = []
cyclic_list.append(cyclic_list)
@ -13,6 +14,7 @@ def test_to_hashable_returns_unhashable_for_cyclic_builtin_containers():
def test_to_hashable_returns_unhashable_when_max_depth_is_reached():
"""Ensure deeply nested built-in containers stop at the configured depth limit."""
nested = current = []
for _ in range(32):
next_item = []