Hi All,

I'm pretty new to python and still getting to know how python works. I want
to associate some metadata to a function.
In javascript I'm used to associating metadata with a function as

foo.bar = "foobar";
function foo(){

Whats the normal python practice to do this kind of a thing. Whats the
python way of doing this.

Your help is very much appreciated.

Heshan Suriyaarachchi

Something like that?

def foo():
    return foo.bar

foo.bar = "foobar"

print foo()  # foobar