Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>There is a <a href="http://docs.python.org/2/library/functions.html#dir" rel="nofollow noreferrer">dir</a> function, which lists all (well, pretty much) attributes of the object. But to filter only functions isn't a problem:</p> <pre><code> &gt;&gt;&gt;import math &gt;&gt;&gt;dir(math) ['__doc__', '__name__', '__package__', 'acos', 'acosh', 'asin', 'asinh', 'atan', 'atan2', 'atanh', 'ceil', 'copysign', 'cos', 'cosh', 'degrees', 'e', 'erf', 'erfc', 'exp', 'expm1', 'fabs', 'factorial', 'floor', 'fmod', 'frexp', 'fsum', 'gamma', 'hypot', 'isinf', 'isnan', 'ldexp', 'lgamma', 'log', 'log10', 'log1p', 'modf', 'pi', 'pow', 'radians', 'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'trunc'] &gt;&gt;&gt; &gt;&gt;&gt;[f for f in dir(math) if hasattr(getattr(math, f), '__call__')] # filter on functions ['acos', 'acosh', 'asin', 'asinh', 'atan', 'atan2', 'atanh', 'ceil', 'copysign', 'cos', 'cosh', 'degrees', 'erf', 'erfc', 'exp', 'expm1', 'fabs', 'factorial', 'floor', 'fmod', 'frexp', 'fsum', 'gamma', 'hypot', 'isinf', 'isnan', 'ldexp', 'lgamma', 'log', 'log10', 'log1p', 'modf', 'pow', 'radians', 'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'trunc'] </code></pre> <p>You might find the <a href="http://www.ibm.com/developerworks/linux/library/l-pyint/index.html" rel="nofollow noreferrer">Guide to Python introspection</a> to be a useful resource, as well as this question: <a href="https://stackoverflow.com/questions/624926/how-to-detect-whether-a-python-variable-is-a-function">how to detect whether a python variable is a function?</a>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload