David <71da...@libero.it> writes: > Il Sat, 17 Oct 2009 23:43:36 -0700 (PDT), StarWing ha scritto: > > > I got a idea, use a try...except statement. there are another way to > > do it ? > > > > (I just curious now, because I solve my problem in another way :-) > > locals().has_key(myname) > globals().has_key(myname)
The ‘dict.has_key’ method is deprecated, and is removed in Python 3. The ‘in’ operator now works on dict objects: 'foo' in locals() 'foo' in globals() -- \ “We must become the change we want to see.” —Mahatma Gandhi | `\ | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list