<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>On May 14, 2013, at 12:53, Jonathan Eunice <<a href="mailto:jonathan.eunice@gmail.com">jonathan.eunice@gmail.com</a>> wrote:</div><div><br></div><blockquote type="cite"><p style="color: rgb(0, 0, 0); font-family: lato, sans-serif; line-height: 20px; "><span style="font-size: small; ">Using a compatible, separate implementation for </span><code style="font-size: small; color: rgb(0, 0, 102); padding-right: 2px; padding-left: 2px; ">OrderedDict</code><span style="font-size: small; "> is a fine way to gracefully extend the language, but it leaves ordering only half-accomodated. Consider:</span></p><div class="codehilite" style="margin: 0.25in; color: rgb(0, 0, 0); font-family: lato, sans-serif; line-height: 20px; "><pre><font size="2"><span class="n">OrderedDict</span><span class="p">(</span><span class="n">a</span><span class="o" style="color: rgb(102, 102, 102); ">=</span><span class="mi" style="color: rgb(64, 160, 112); ">2</span><span class="p">,</span> <span class="n">b</span><span class="o" style="color: rgb(102, 102, 102); ">=</span><span class="mi" style="color: rgb(64, 160, 112); ">3</span><span class="p">,</span> <span class="n">c</span><span class="o" style="color: rgb(102, 102, 102); ">=</span><span class="mi" style="color: rgb(64, 160, 112); ">7</span><span class="p">)</span>
</font></pre></div><p style="color: rgb(0, 0, 0); font-family: lato, sans-serif; line-height: 20px; "></p></blockquote><div>If your proposal is to replace dict with OrderedDict, I think you need at least one use case besides OrderedDict's constructor.</div><blockquote type="cite"><p style="color: rgb(0, 0, 0); font-family: lato, sans-serif; line-height: 20px; "><font size="2">But from an app developer’s point of view, ordering is a basic, essential property.</font></p></blockquote><div>There are plenty of things that are basic, essential properties of a particular type, but there is very little that's a basic, essential property of _all_ types.</div><div><br></div><div>Surely you wouldn't suggest that a complex number should remember whether you specified the real or imaginary component first.</div><div><br></div><div>So your argument is that order of insertion is a basic property of _mappings_ in particular.</div><div><br></div><div>And I think blist.sorteddict, trie.Trie, etc. are good arguments against even that assertion. It's not just about performance; it's about correctness. Insertion order is not a fundamental property of mappings.</div><div><br></div><div>If you're just suggesting that collections.abc should grow an OrderedMapping, and/or that kwargs should be an OrderedDict, either or both might be reasonable.</div><div><br></div><div>But if you're suggesting that Mapping and dict should both become ordered, I disagree with both. </div></body></html>