Merge branch 'master' into v3-definition - async v3 nodes do not currently work, but I will fix that in the next v3 PR

This commit is contained in:
Jedrzej Kosinski
2025-07-18 14:14:02 -07:00
37 changed files with 2437 additions and 480 deletions

View File

@@ -112,3 +112,15 @@ def lock_class(cls):
locked_dict['__setattr__'] = locked_instance_setattr
return LockedMeta(cls.__name__, cls.__bases__, locked_dict)
def make_locked_method_func(type_obj, func, class_clone):
"""
Returns a function that, when called with **inputs, will execute:
getattr(type_obj, func).__func__(lock_class(class_clone), **inputs)
"""
locked_class = lock_class(class_clone)
method = getattr(type_obj, func).__func__
def wrapped_func(**inputs):
return method(locked_class, **inputs)
return wrapped_func