[Python-Dev] Guarantee ordered dict literals in v3.7?

Paul G paul at ganssle.io
Mon Nov 6 14:23:13 EST 2017


Is there a major objection to just adding in explicit syntax for order-preserving dictionaries? To some extent that seems like a reasonable compromise position in an "explicit is better than implicit" sense. A whole lot of code is out there that doesn't require or expect order-preserving dictionaries - it would be nice to be able to differentiate out the parts where order actually *does* matter.

(Of course, given that CPython's implementation is order-preserving, a bunch of code is probably now being written that implicitly requires on this detail, but at least having syntax that makes that clear would give people the *option* to make the assumption explicit).

On 11/06/2017 01:19 PM, Barry Warsaw wrote:
> On Nov 6, 2017, at 02:18, Paul Sokolovsky <pmiscml at gmail.com> wrote:
> 
>> What it will lead to is further fragmentation of the community. Python2
>> vs Python3 split is far from being over, and now there're splits
>> between:
>>
>> * people who use "yield from" vs "await"
>> * people who use f-strings vs who don't
>> * people who rely on sorted nature of dict's vs who don't
> 
> This is the classic argument of, do you proceed conservatively and use the lowest-common denominator that makes your code work with the widest range of versions, or do you ride the wave and adopt the latest and greatest features as soon as they’re available?
> 
> Neither answer is wrong or right… for everyone.  It’s also a debate as old as the software industry. Every package, project, company, developer, community will have to decide for themselves.  Once you realize you can’t win, you’ve won! :)
> 
> -Barry
> 
> 
> 
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> https://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: https://mail.python.org/mailman/options/python-dev/paul%40ganssle.io
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/python-dev/attachments/20171106/20b5d46e/attachment.sig>


More information about the Python-Dev mailing list