0

Consider a function that contains definitions of some other functions. Is there a way to list all the functions defined inside a function?

For example, if there is a function f defined as below, how can I list all the functions defined within f?

def f(x):
    def g(y):
        return y

    def h(z):
        return z

    return x
SultanOrazbayev
  • 14,900
  • 3
  • 16
  • 46
  • 2
    https://stackoverflow.com/questions/26609867/python-list-all-inner-functions-of-a-function may be relevant? – Sash Sinha Jan 11 '22 at 04:58
  • 1
    or https://stackoverflow.com/q/1234672/1682419 ? For interactive use, look at the Structure view in an editor like PyCharm. – Jerry101 Jan 11 '22 at 04:59

0 Answers0