touketsu.core.urt_class

@touketsu.core.urt_class

Remove the touketsu restriction from a touketsu decorated 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 touketsu decorator 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 from class_decorator_factory() will result in warnings being raised, as the _touketsu_restriction and _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

type