[ python-Feature Requests-1656538 ] dict(key,values) initializer

SourceForge.net noreply at sourceforge.net
Tue Mar 20 20:08:04 CET 2007


Feature Requests item #1656538, was opened at 2007-02-09 21:05
Message generated for change (Comment added) made by rhettinger
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1656538&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: Python 2.6
>Status: Closed
>Resolution: Rejected
Priority: 5
Private: No
Submitted By: George Sakkis (gsakkis)
Assigned to: Nobody/Anonymous (nobody)
Summary: dict(key,values) initializer

Initial Comment:
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 it.
- More concise (especially if one imports itertools just to use izip).
- At least as efficient (and probably more) as the current alternatives.
- Backwards compatible.

George

----------------------------------------------------------------------

>Comment By: Raymond Hettinger (rhettinger)
Date: 2007-03-20 14:08

Message:
Logged In: YES 
user_id=80475
Originator: NO

Sorry, the number of options for the dict constructor is already at its
outer limit.  No need to further complicate the situation in order to save
just five or six characters in the invocation.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1656538&group_id=5470


More information about the Python-bugs-list mailing list