O'Reilly logo

Python: Essential Reference, Third Edition by David Beazley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required