inspect.getdoc()

inspect.getdoc(object) Get the documentation string for an object, cleaned up with cleandoc(). If the documentation string for an object is not provided and the object is a class, a method, a property or a descriptor, retrieve the documentation string from the inheritance hierarchy. Changed in version 3.5: Documentation strings are now inherited if not overridden.

inspect.getcoroutinestate()

inspect.getcoroutinestate(coroutine) Get current state of a coroutine object. The function is intended to be used with coroutine objects created by async def functions, but will accept any coroutine-like object that has cr_running and cr_frame attributes. Possible states are: CORO_CREATED: Waiting to start execution. CORO_RUNNING: Currently being executed by the interpreter. CORO_SUSPENDED: Currently suspended at an await expression. CORO_CLOSED: Execution has completed. New in version

inspect.getcoroutinelocals()

inspect.getcoroutinelocals(coroutine) This function is analogous to getgeneratorlocals(), but works for coroutine objects created by async def functions. New in version 3.5.

inspect.getcomments()

inspect.getcomments(object) Return in a single string any lines of comments immediately preceding the object’s source code (for a class, function, or method), or at the top of the Python source file (if the object is a module).

inspect.getclosurevars()

inspect.getclosurevars(func) Get the mapping of external name references in a Python function or method func to their current values. A named tuple ClosureVars(nonlocals, globals, builtins, unbound) is returned. nonlocals maps referenced names to lexical closure variables, globals to the function’s module globals and builtins to the builtins visible from the function body. unbound is the set of names referenced in the function that could not be resolved at all given the current module global

inspect.getclasstree()

inspect.getclasstree(classes, unique=False) Arrange the given list of classes into a hierarchy of nested lists. Where a nested list appears, it contains classes derived from the class whose entry immediately precedes the list. Each entry is a 2-tuple containing a class and a tuple of its base classes. If the unique argument is true, exactly one entry appears in the returned structure for each class in the given list. Otherwise, classes using multiple inheritance and their descendants will ap

inspect.getcallargs()

inspect.getcallargs(func, *args, **kwds) Bind the args and kwds to the argument names of the Python function or method func, as if it was called with them. For bound methods, bind also the first argument (typically named self) to the associated instance. A dict is returned, mapping the argument names (including the names of the * and ** arguments, if any) to their values from args and kwds. In case of invoking func incorrectly, i.e. whenever func(*args, **kwds) would raise an exception becau

inspect.getattr_static()

inspect.getattr_static(obj, attr, default=None) Retrieve attributes without triggering dynamic lookup via the descriptor protocol, __getattr__() or __getattribute__(). Note: this function may not be able to retrieve all attributes that getattr can fetch (like dynamically created attributes) and may find attributes that getattr can’t (like descriptors that raise AttributeError). It can also return descriptors objects instead of instance members. If the instance __dict__ is shadowed by another

inspect.getargvalues()

inspect.getargvalues(frame) Get information about arguments passed into a particular frame. A named tuple ArgInfo(args, varargs, keywords, locals) is returned. args is a list of the argument names. varargs and keywords are the names of the * and ** arguments or None. locals is the locals dictionary of the given frame. Deprecated since version 3.5: Use signature() and Signature Object, which provide a better introspecting API for callables.

inspect.getargspec()

inspect.getargspec(func) Get the names and default values of a Python function’s arguments. A named tuple ArgSpec(args, varargs, keywords, defaults) is returned. args is a list of the argument names. varargs and keywords are the names of the * and ** arguments or None. defaults is a tuple of default argument values or None if there are no default arguments; if this tuple has n elements, they correspond to the last n elements listed in args. Deprecated since version 3.0: Use signature() and