getting the current function
ldo at geek-central.gen.new_zealand
Sun Sep 9 10:05:17 CEST 2007
In message <mailman.229.1189182388.2658.python-list at python.org>, Gary
> I've just never liked the fact that you have to name the function when
> accessing those attributes from within the function.
If it's any consolation, it's not actually the function name you need to
refer to, merely any variable or Python object that happens to hold a
reference to the right function:
>>> f = lambda x : x + x
>>> f.myattr = "yeah"
>>> g = f
>>> g = [f]
More information about the Python-list