reflection

oslo_utils.reflection.accepts_kwargs(function)

Returns True if function accepts kwargs.

oslo_utils.reflection.get_all_class_names(obj, up_to=<type 'object'>)

Get class names of object parent classes.

Iterate over all class names object is instance or subclass of, in order of method resolution (mro). If up_to parameter is provided, only name of classes that are sublcasses to that class are returned.

oslo_utils.reflection.get_callable_args(function, required_only=False)

Get names of callable arguments.

Special arguments (like *args and **kwargs) are not included into output.

If required_only is True, optional arguments (with default values) are not included into output.

oslo_utils.reflection.get_callable_name(function)

Generate a name from callable.

Tries to do the best to guess fully qualified callable name.

oslo_utils.reflection.get_class_name(obj, fully_qualified=True)

Get class name for object.

If object is a type, fully qualified name of the type is returned. Else, fully qualified name of the type of the object is returned. For builtin types, just name is returned.

oslo_utils.reflection.get_member_names(obj, exclude_hidden=True)

Get all the member names for a object.

oslo_utils.reflection.get_members(obj, exclude_hidden=True)

Yields the members of an object, filtering by hidden/not hidden.

oslo_utils.reflection.get_method_self(method)

Gets the self object attached to this method (or none).

oslo_utils.reflection.is_bound_method(method)

Returns if the given method is bound to an object.

oslo_utils.reflection.is_same_callback(callback1, callback2, strict=True)

Returns if the two callbacks are the same.

oslo_utils.reflection.is_subclass(obj, cls)

Returns if the object is class and it is subclass of a given class.