hbutils.reflection.clazz

Overview:

Useful functions for processing python classes and types.

class_wraps

hbutils.reflection.clazz.class_wraps(wrapped: type, assigned: Tuple[str] = '__module__', '__name__', '__qualname__', '__doc__', '__annotations__', updated: Tuple[str] = ())[source]
Overview:

Wrapper decorator for class.

Arguments:
  • wrapped (type): Wrapped class.

  • assigned (Tuple[str]): Wrapper assignments, equal to functools.wraps()’s

    WRAPPER_ASSIGNMENTS.

  • updated (Tuple[str]): Wrapper updates, default is (), no update will be done.

Examples:
>>> def cls_dec(clazz):
>>>     @class_wraps(clazz)
>>>     class _NewClazz(clazz):
>>>         pass
>>>
>>>     return _NewClazz