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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.