mirror of
https://github.com/Faraphel/Atlas-Install.git
synced 2025-07-03 03:08:29 +02:00
added a safe type function (disable the creation of class)
This commit is contained in:
parent
4ebd01e924
commit
edb19e02e4
1 changed files with 8 additions and 0 deletions
|
@ -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:
|
||||
"""
|
||||
|
|
Loading…
Reference in a new issue