0

Assuming I have a (mathematical) function hyperbolic (it can also be a lambda function):

def hyperbolic(x):
    return a*x + b

I know its possible to pass it in another function and get the name (and other parameters) like so:

def inspect(func):
   print (func.__name__)

My question is:

is it possible to printout the actual mathematical code of the function?

NMech
  • 580
  • 2
  • 8
  • 20
  • Possible duplicate of [https://stackoverflow.com/questions/399991/how-do-you-get-python-to-write-down-the-code-of-a-function-it-has-in-memory](https://stackoverflow.com/questions/399991/how-do-you-get-python-to-write-down-the-code-of-a-function-it-has-in-memory) – Jakub Sowa Oct 31 '21 at 10:30
  • What exactly do you mean by _the actual mathematical code of the function_, e.g. in the example case? – buran Oct 31 '21 at 10:42

0 Answers0