inspect

The inspect module is used to gather information about live Python objects such as attributes, documentation strings, source code, and so on.

currentframe()

Returns the frame object corresponding to the caller’s stack frame.

formatargspec(args [, varags [, varkw [, defaults]]])

Produces a nicely formatted string representing the values returned by getargspec().

formatargvalues(args [, varargs [, varkw [, locals]]])

Produces a nicely formatted string representing the values returned by getargvalues().

getargspec(func)

Given a function, func, returns a tuple (args, varargs, varkw, defaults). args is a list of argument names, varargs is the name of the * argument (if any). varkw is the name of the ** argument (if any), and defaults is a ...

Get Python: Essential Reference, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.