Is it possible to modify how the function
or lambda
is printed in python (from within the console)? As an example:
>>> def F():
... return 2
>>> F
<function F at 0x10442da28>
>>> L = lambda: 2
>>> L
<function <lambda> at 0x10442daa0>
For example, printing it like this instead:
>>> L
<lambda function "L">
>>> F
<function "F">
I am debugging some functional code so would like to be able to see the name of functions (mostly lambdas) instead of just the generic <function <lambda>
whenever one is used.