introspect

New in version 1.1.0.

Introspection

class smisk.util.introspect.introspect
callable_info

Info about a callable.

The results are cached for efficiency.

Parameters:
  • f (callable) –
Return type:

frozendict

ensure_va_kwa

Ensures f accepts both *varargs and **kwargs.

If f does not support *args, it will be wrapped with a function which cuts away extra arguments in *args.

If f does not support *args, it will be wrapped with a function which discards the **kwargs.

Parameters:
  • f (callable) –
  • parent (object) – The parent on which f is defined. If specified, we will perform parent.<name of f> = wrapper in the case we needed to wrap f.
Returns:

A callable which is guaranteed to accept both *args and **kwargs.

Return type:

callable

format_members
getargspec

Returns a tuple of 5 objects: bool is_method, list args, string varargs, string varkw, list defaults

Return type:tuple