b3j0f.utils.reflect module¶
Python reflection tools.
-
b3j0f.utils.reflect.
base_elts
(elt, cls=None, depth=None)[source]¶ Get bases elements of the input elt.
- If elt is an instance, get class and all base classes.
- If elt is a method, get all base methods.
- If elt is a class, get all base classes.
- In other case, get an empty list.
Parameters: - elt – supposed inherited elt.
- cls (type or list) – cls from where find attributes equal to elt. If None, it is found as much as possible. Required in python3 for function classes.
- depth (int) – search depth. If None (default), depth is maximal.
Returns: elt bases elements. if elt has not base elements, result is empty.
Return type: