On Mon, Nov 12, 2012 at 11:41:59PM +0000, Joshua Landau wrote:
>
> Dict comprehension:
> {i:[] for i in ["Test 1", "Test 2", "Test 3"]}
In Python 2.6 this syntax is not supported. You can achieve the same
there via
dict((i, []) for i in ['Test 1', 'Test 2', 'Test 3'])
Also have a look at ``collections.defaultdict``.
Regards,
Thomas.
--
http://mail.python.org/mailman/listinfo/python-list
