Function attributes

Muhammad Alkarouri malkarouri at gmail.com
Wed Feb 10 14:59:41 CET 2010


Hi everyone,

What is the simplest way to access the attributes of a function from
inside it, other than using its explicit name?
In a function like f below:

def f(*args):
    f.args = args
    print args

is there any other way?
I am guessing the next question will be: should I really care? It just
feels like there should be a way, but I am not able to verbalise a
valid one at the moment, sorry.

Regards,

Muhammad Alkarouri



More information about the Python-list mailing list