Consider the two functions below:
def f1(): return \"potato\" f2 = lambda: \"potato\" f2.__name__ = f2.__qualname__ = \"f2\"
Short of
Here
def f1(): return "potato" f2 = lambda: "potato" def is_lambda(f): return '' in str(f.__code__) print(is_lambda(f1)) print(is_lambda(f2))
output
False True