Source code for direct.extensions_native.extension_native_helpers

__all__ = ["Dtool_ObjectToDict", "Dtool_funcToMethod"]


[docs]def Dtool_ObjectToDict(cls, name, obj): cls.DtoolClassDict[name] = obj
[docs]def Dtool_funcToMethod(func, cls, method_name=None): """Adds func to class so it is an accessible method; use method_name to specify the name to be used for calling the method. The new method is accessible to any instance immediately.""" func.__func__ = func func.__self__ = None if not method_name: method_name = func.__name__ cls.DtoolClassDict[method_name] = func