mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-03-21 17:13:38 +08:00
Add missing docstrings
This commit is contained in:
parent
880b51ac4f
commit
4b431ffc27
@ -47,6 +47,8 @@ class CacheKeySet(ABC):
|
|||||||
return self.subcache_keys.get(node_id, None)
|
return self.subcache_keys.get(node_id, None)
|
||||||
|
|
||||||
class Unhashable:
|
class Unhashable:
|
||||||
|
"""Hashable sentinel used when an input cannot be safely represented."""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
"""Create a hashable sentinel value for unhashable prompt inputs."""
|
"""Create a hashable sentinel value for unhashable prompt inputs."""
|
||||||
self.value = float("NaN")
|
self.value = float("NaN")
|
||||||
|
|||||||
@ -2,6 +2,7 @@ from comfy_execution.caching import Unhashable, to_hashable
|
|||||||
|
|
||||||
|
|
||||||
def test_to_hashable_returns_unhashable_for_cyclic_builtin_containers():
|
def test_to_hashable_returns_unhashable_for_cyclic_builtin_containers():
|
||||||
|
"""Ensure self-referential built-in containers terminate as Unhashable."""
|
||||||
cyclic_list = []
|
cyclic_list = []
|
||||||
cyclic_list.append(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():
|
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 = []
|
nested = current = []
|
||||||
for _ in range(32):
|
for _ in range(32):
|
||||||
next_item = []
|
next_item = []
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user