Thank you everyone. I ended up implementing the dict.get() method, which seems "cleaner", but I'll keep the (x if y else z) syntax in mind. I didn't know it existed, I guess it's what I was looking for to begin with.

Thanks again!

Allen wrote:
kretik wrote:
I'm sure this is a popular one, but after Googling for a while I couldn't figure out how to pull this off.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to