is it possible to access the python function object attributes from within the function scope?
e.g. let\'s have
def f():
return
I doubt this is the best way to accomplish this, but you can access the attributes by using the method's name within the method:
>>> def foo():
... print foo.x
...
>>> foo()
Traceback (most recent call last):
File "", line 1, in
File "", line 2, in foo
AttributeError: 'function' object has no attribute 'x'
>>> foo.x = 5
>>> foo()
5