Re: [Tutor] Dictionary of dictionaries issue

2008-11-13 Thread Pablo Englebienne
Thank you all, this is exactly what I was trying to do and the syntax is beautiful... :-) -- Pablo Englebienne "Progress is made by lazy men looking for easier ways to do things." - Robert A. Heinlein Kent Johnson wrote: On Thu, Nov 13, 2008 at 10:01 AM, A.T.Hofkamp <[EMAIL PROTECTED]> wro

Re: [Tutor] Dictionary of dictionaries issue

2008-11-13 Thread Tim Golden
Kent Johnson wrote: On Thu, Nov 13, 2008 at 10:01 AM, A.T.Hofkamp <[EMAIL PROTECTED]> wrote: d3 = dict(( (rv, dict.fromkeys(c)) for rv in r )) You don't need the double parentheses, this works just as well: d3 = dict( (rv, dict.fromkeys(c)) for rv in r ) A generator expression just has to be

Re: [Tutor] Dictionary of dictionaries issue

2008-11-13 Thread Kent Johnson
On Thu, Nov 13, 2008 at 10:01 AM, A.T.Hofkamp <[EMAIL PROTECTED]> wrote: d3 = dict(( (rv, dict.fromkeys(c)) for rv in r )) You don't need the double parentheses, this works just as well: d3 = dict( (rv, dict.fromkeys(c)) for rv in r ) A generator expression just has to be in parentheses, it'

Re: [Tutor] Dictionary of dictionaries issue

2008-11-13 Thread Kent Johnson
On Thu, Nov 13, 2008 at 8:11 AM, Pablo Englebienne <[EMAIL PROTECTED]> wrote: > Hi, I'm trying to work with a dictionary of dictionaries and I'm having > trouble accessing a specific element of it: > > $ python > Python 2.6 (trunk:66714:66715M, Oct 1 2008, 18:36:04) > [GCC 4.0.1 (Apple Computer, I

Re: [Tutor] Dictionary of dictionaries issue

2008-11-13 Thread A.T.Hofkamp
Pablo Englebienne wrote: Hi, I'm trying to work with a dictionary of dictionaries and I'm having trouble accessing a specific element of it: $ python Python 2.6 (trunk:66714:66715M, Oct 1 2008, 18:36:04) [GCC 4.0.1 (Apple Computer, Inc. build 5370)] on darwin Type "help", "copyright", "credits

[Tutor] Dictionary of dictionaries issue

2008-11-13 Thread Pablo Englebienne
Hi, I'm trying to work with a dictionary of dictionaries and I'm having trouble accessing a specific element of it: $ python Python 2.6 (trunk:66714:66715M, Oct 1 2008, 18:36:04) [GCC 4.0.1 (Apple Computer, Inc. build 5370)] on darwin Type "help", "copyright", "credits" or "license" for more i