how to safely extract dict values

2006-07-31 Thread David Zaret
i have a dict with a particular key - the values for this key will be None, one valid scalar, or a list: {mykey, None} {mykey, "foo"} {mykey, ["bar", "baz"]} let's ignore the None case - in the case of the one or many values, i want to suck the values into a list. here'

Re: how to safely extract dict values

2006-07-31 Thread David Zaret
7;s posted below - that's more compact - and at least closer to what i was looking for. thanks again, great newsgroup. dz Bruno Desthuilliers wrote: > David Zaret wrote: >> i have a dict with a particular key - the values for this key will be >> None, one va