Is there way to do a type comparison for lambdas and def functions? I expect False to be output via some procedure, but I don't know if that level of granularity is native to python functions. My use case is making sure that a function registered to an event is not a lambda so it can be unregisterable later via another method.
def foo():
pass
(lambda: None).__class__ == foo.__class__ # >> True
Edit: my use case is actually more educational than functional, so I'm really just concerned with ways of distinguishing lambda functions from def functions.