RenamedClass
- omni.graph.tools.RenamedClass(cls, old_class_name: str, rename_message: Optional[str] = None) object
Syntactic sugar to provide a class deprecation that is a simple renaming, where all of the functions in the old class are still present in backwards compatible form in the new class.
- Parameters
old_class_name – The name of the class that was renamed
rename_message – Message to give the user if the old class name is used. A generic message will be provided if this is None.
Usage:
MyDeprecatedClass = RenamedClass(MyNewClass, "MyDeprecatedClass") obj = MyDeprecatedClass() # Gives a deprecation warning obj = MyNewClass() # Works fine - both calls return the same type of object # This also works for static class members and methods value = MyDeprecatedClass.VALUE # Gives a deprecation warning value = MyDeprecatedClass.class_method() # Gives a deprecation warning value = MyDeprecatedClass.static_method() # Gives a deprecation warning