String representation of an identifier's name

Boethius boethius at techie.com
Sun Jan 12 16:34:47 EST 2003


I think it easier to explain with an example, so here it goes:
Assuming there's a function fn that does what I want, it would work like this:

g = 23
foo = {'a':56}

fn(g) => 'g'
fn(foo) => 'foo'

How can I write fn? O:-)




More information about the Python-list mailing list