Consider the two functions below:
def f1():
return "potato"
f2 = lambda: "potato"
f2.__name__ = f2.__qualname__ = "f2"
Short of introspecting the original source code, is there any way to detect that f1 was a def and f2 was a lambda?
>>> black_magic(f1)
"def"
>>> black_magic(f2)
"lambda"