> Yeah, it's remarkably easy too! Try this:
>
> [(k, x) for k, v in my_dict.items() for x in v or [None]]
>
> An empty list counts as false, so the 'or' will then take the second option, 
> and iterate over the one-item list with > > None in it.

Right, I overlooked that!

Much appreciated,
jlc
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to