<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 10 September 2016 at 03:17, Guido van Rossum <span dir="ltr"><<a href="mailto:guido@python.org" target="_blank">guido@python.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I've been asked about this. Here's my opinion on the letter of the law in 3.6:<br>
<br>
- keyword args are ordered<br>
- the namespace passed to a metaclass is ordered by definition order<br>
- ditto for the class __dict__<br>
<br>
A compliant implementation may ensure the above three requirements<br>
either by making all dicts ordered, or by providing a custom dict<br>
subclass (e.g. OrderedDict) in those three cases.<br></blockquote><div><br></div><div>I'd like to add one more documented constraint - that dict literals maintain definition order (so long as the dict is not further modified). This allows defining a dict literal and then passing it as **kwargs.</div><div><br></div><div>Hmm - again, there's no mention of dict literals in the PEPs. I'm assuming that dict literals will preserve their definition order with the new implementation, but is that a valid assumption? Guess I can test it now 3.6.0b1 is out.</div><div><br></div><div>Tim Delaney </div></div></div></div>