Updated to 0.0.6 with stricter types

This commit is contained in:
akatz-ai
2025-07-05 11:50:31 -07:00
parent a79135d3b1
commit 7efab18b8a
3 changed files with 134 additions and 86 deletions
+17
View File
@@ -1,4 +1,18 @@
class AnyType(str):
"""A special class that is always equal in not equal comparisons. Credit to pythongosssss"""
def __ne__(self, __value: object) -> bool:
return False
class ByPassTypeTuple(tuple):
"""A special class that will return additional "AnyType" strings beyond defined values.
Credit to Trung0246
"""
def __getitem__(self, index):
if index > len(self) - 1:
return AnyType("*")
return super().__getitem__(index)
def MakeSmartType(t):
if isinstance(t, str):
return SmartType(t)
@@ -63,3 +77,6 @@ def VariantSupport():
return cls
return decorator
# Create a global any_type instance for use in nodes
any_type = AnyType("*")