feat: textgate AnyType wildcard
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,14 @@
|
|||||||
|
# gates/textgate.py
|
||||||
|
from . import gate_bus
|
||||||
|
|
||||||
|
NODE_CLASS_MAPPINGS = {}
|
||||||
|
NODE_DISPLAY_NAME_MAPPINGS = {}
|
||||||
|
|
||||||
|
|
||||||
|
class AnyType(str):
|
||||||
|
"""Type that compares equal to any other type (ComfyUI wildcard convention)."""
|
||||||
|
def __ne__(self, other):
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
ANY = AnyType("*")
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# tests/test_textgate.py
|
||||||
|
from gates import textgate
|
||||||
|
|
||||||
|
def test_anytype_is_compatible_with_everything():
|
||||||
|
assert (textgate.ANY != "IMAGE") is False
|
||||||
|
assert (textgate.ANY != "LATENT") is False
|
||||||
|
assert isinstance(textgate.ANY, str)
|
||||||
Reference in New Issue
Block a user