touketsu.core.urt_class¶
-
@touketsu.core.urt_class¶ Remove the
touketsurestriction from atouketsudecorated class.For any class decorated by a decorator returned by
class_decorator_factory(),urt_class()removes the decorator’s effect, restoring the original__init__()and__setattr__()methods.Useful for removing a
touketsudecorator restriction from a decorated class during runtime or a subclass that does not override__init__(), which results in a superclass__init__()beind used instead according to the method resolution order.Note
If the class is undecorated, then
urt_class()will have no effect.Note
Calling
urt_class()on subclasses of classes decorated by a decorator returned fromclass_decorator_factory()will result in warnings being raised, as the_touketsu_restrictionand_touketsu_orig__doc__attributes cannot be deleted from the subclass, as they are superclass attributes. These warnings can be safely ignored, however.- Parameters
cls (type) – Class decorated by
class_decorator_factory()decorator- Returns
The original class, without decoration
- Return type