added a safe type function (disable the creation of class)

This commit is contained in:
Faraphel 2022-08-02 18:03:40 +02:00
parent 4ebd01e924
commit edb19e02e4

View file

@ -56,6 +56,14 @@ class SafeFunction:
if callable(attr): raise AttributeError(f"getattr can't be used for functions (tried: {attr})")
return attr
@staticmethod
def type(obj: any) -> any:
"""
Safe type, can only be used to determinate the type of an object
(It can be used to create new class by using all the 3 args)
"""
return type(obj)
def replace_macro(template: str, macros: dict[str, str]) -> str:
"""