Hi,

Till now, when I receive a dictionary that I'm not sure contains a certain
key, I would use the following template to access a given key:

if 'someKey' in dict.keys():
   someData = dict['someKey']

is there a faster way to do this? accessing a key that does not exist will
through an exception, which is just as tiresome...

Thanks

Elisha
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to