George Sakkis wrote:
Perhaps this has been brought up in the past but I couldn't find it in
the archives: far too often I use the idiom dict(zip(keys,values)), or
the same with izip. How does letting dict take two positional
arguments sound ?
Pros:
- Pretty obvious semantics, no mental
On 2/1/07, Brian Quinlan [EMAIL PROTECTED] wrote:
George Sakkis wrote:
Perhaps this has been brought up in the past but I couldn't find it in
the archives: far too often I use the idiom dict(zip(keys,values)), or
the same with izip. How does letting dict take two positional
arguments
Brian Quinlan wrote:
George Sakkis wrote:
Perhaps this has been brought up in the past but I couldn't find it in
the archives: far too often I use the idiom dict(zip(keys,values)), or
the same with izip. How does letting dict take two positional
arguments sound ?
Pros:
- Pretty obvious
George Sakkis wrote:
Um, you do realize that dict(keys=keys, values=values) is already
valid and quite different from dict(zip(keys, values)), don't you ? :)
Sorry, minor misreading on my part. Like that time in Sunday school when
I missed the not in Though shall not kill. That was a rough
Unfortunately
dict(keys=keys, values=values) == {keys: values}
Ummm, no:
dict(keys=keys, values=values) == {'keys': keys, 'values': values}
___
Python-Dev mailing list
Python-Dev@python.org
Andrew Koenig wrote:
Unfortunately
dict(keys=keys, values=values) == {keys: values}
Ummm, no:
dict(keys=keys, values=values) == {'keys': keys, 'values': values}
Of course I should really have written
dict(keys=keys, values=values) != dict(zip(keys, values))
regards
George Sakkis wrote:
far too often I use the idiom dict(zip(keys,values)), or
the same with izip. How does letting dict take two positional
arguments sound ?
I think the dict constructor is already a bit too complicated, and
would prefer that it be a separate classmethod, such as
Perhaps this has been brought up in the past but I couldn't find it in
the archives: far too often I use the idiom dict(zip(keys,values)), or
the same with izip. How does letting dict take two positional
arguments sound ?
Pros:
- Pretty obvious semantics, no mental overhead to learn and remember