[Python-ideas] Accepting multiple mappings as positional arguments to create dicts

Mike Miller python-ideas at mgmiller.net
Sun Apr 15 17:13:59 EDT 2018

On 2018-04-12 18:03, Guido van Rossum wrote:
> It's a slippery slope indeed. While having to change update() alone wouldn't 
> worry me, the subclass constructors do seem like they are going to want changing 
> too, and that's indeed a bit much. So let's back off a bit. Not every three 
> lines of code need a built-in shorthand.

This is disappointing since the dictionary is one of the most used but 
simultaneously limited of the builtin types.  It doesn't support a lot of 
operations that strings, lists, tuples, sets, etc do.  These are the little 
niceties that make Python fun to program in.  But, for some reason we're stingy 
when it comes to dictionaries, the foundation of the language.

Has anyone disagreed the dict constructor shouldn't take multiple arguments?

Also, it isn't always three lines of code, but expands with the number that need 
to be merged.

My guess is that the dict is used an order of magnitude more than specialized 
subclasses, even more so now that the Ordered variant is unnecessary in newer 
versions.  It wouldn't bother me at all if it took a few years for the 
improvement to get rolled out to subclasses or never, it's quite a minor 
disappointment compared to getting the functionality ~90% of the time.

Also wouldn't mind helping out with the subclasses if there is some lifting that 
needed to be done.


More information about the Python-ideas mailing list