<div dir="auto">Sometimes I feel that it would be neat of dict constructors (like proposed previously in the thread) could also be chained, e.g.:<div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">dict.ordered.default(int)(a=1, b=2)<br><br><div data-smartmail="gmail_signature" dir="auto">--<br>Ryan (ライアン)<br>Yoko Shimomura > ryo (supercell/EGOIST) > Hiroyuki Sawano >> everyone else<br><a href="http://refi64.com">http://refi64.com</a></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On May 29, 2017 2:06 PM, "Neil Girdhar" <<a href="mailto:mistersheik@gmail.com">mistersheik@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">A long time ago, I proposed that the dict variants (sorteddict, defaultdict, weakkeydict, etc.) be made more discoverable by having them specified as keyword arguments and I got the same feedback that the poster here is getting. Now, instead of moving these classes into dict, why not have a factory like<div><br></div><div>dict.factory(values=None, *, ordered=True, sorted=False, has_default=False, weak_keys=False, weak_values=False, …)</div><div><br></div><div>If prefers the keyword-argument as options to the keyword-argument as initializer magic, they can set:</div><div><br></div><div>dict = dict.factory</div><div><br></div><div>Best,</div><div><br></div><div>Neil</div><div><div> <br>On Thursday, March 9, 2017 at 5:58:43 PM UTC-5, Chris Barker wrote:<blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">>If we really want to make defaultdict feel more "builtin" (and I don't see<br>
>any reason to do so), I'd suggest adding a factory function:<br>
><br>
>dict.defaultdict(int)<br></blockquote><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Nice.<br></blockquote><div><br></div><div>I agree -- what about:</div><div><br></div><div>dict.sorteddict() ??</div><div><br></div><div>make easy access to various built-in dict variations...</div><div><br></div><div>-CHB</div><div><br></div></div><div><br></div>-- <br><div><br>Christopher Barker, Ph.D.<br>Oceanographer<br><br>Emergency Response Division<br>NOAA/NOS/OR&R <a href="tel:(206)%20526-6959" value="+12065266959" target="_blank">(206) 526-6959</a> voice<br>7600 Sand Point Way NE <a href="tel:(206)%20526-6329" value="+12065266329" target="_blank">(206) 526-6329</a> fax<br>Seattle, WA 98115 <a href="tel:(206)%20526-6317" value="+12065266317" target="_blank">(206) 526-6317</a> main reception<br><br><a rel="nofollow">Chris....@noaa.gov</a></div>
</div></div>
</blockquote></div></div></div><br>______________________________<wbr>_________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/<wbr>codeofconduct/</a><br>
<br></blockquote></div></div>