<div dir="ltr"><div>Perhaps you are correct, and I will attempt to remain more constructive on the topic (despite it being an *incredibly* frustrating experience). However, my point remains: this is a patently false thing that is being parroted throughout the Python community, and it's outright insulting to be told my complaints about writing 2/3 compatible code are invalid on the basis of "premature optimization".</div><div><br></div><div>-Mark</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 16, 2014 at 10:57 AM, Brett Cannon <span dir="ltr"><<a href="mailto:brett@python.org" target="_blank">brett@python.org</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Mark, your tone is no longer constructive and is hurting your case in arguing for anything. Please take it down a notch.<br><br><div class="gmail_quote"><div><div class="h5">On Tue Dec 16 2014 at 1:48:59 PM Mark Roberts <<a href="mailto:wizzat@gmail.com" target="_blank">wizzat@gmail.com</a>> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Dec 16, 2014 at 2:45 AM, Antoine Pitrou <span dir="ltr"><<a href="mailto:solipsis@pitrou.net" target="_blank">solipsis@pitrou.net</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="overflow:hidden">Iterating accross a dictionary doesn't need compatibility shims. It's<br>
dead simple in all Python versions:<br>
<br>
$ python2<br>
Python 2.7.8 (default, Oct 20 2014, 15:05:19)<br>
[GCC 4.9.1] on linux2<br>
Type "help", "copyright", "credits" or "license" for more information.<br>
>>> d = {'a': 1}<br>
>>> for k in d: print(k)<br>
...<br>
a<br>
<br>
$ python3<br>
Python 3.4.2 (default, Oct 8 2014, 13:08:17)<br>
[GCC 4.9.1] on linux<br>
Type "help", "copyright", "credits" or "license" for more information.<br>
>>> d = {'a': 1}<br>
>>> for k in d: print(k)<br>
...<br>
a<br>
<br>
Besides, using iteritems() and friends is generally a premature<br>
optimization, unless you know you'll have very large containers.<br>
Creating a list is cheap.<br></div></blockquote><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>It seems to me that every time I hear this, the author is basically admitting that Python is a toy language not meant for "serious computing" (where serious is defined in extremely modest terms). The advice is also very contradictory to literally every talk on performant Python that I've seen at PyCon or PyData or ... well, anywhere. And really, doesn't it strike you as incredibly presumptuous to call the *DEFAULT BEHAVIOR* of Python 3 a "premature optimization"? Isn't the whole reason that the default behavior switch was made is because creating lists willy nilly all over the place really *ISN'T* cheap? This isn't the first time someone has tried to run this line past me, but it's the first time I've been fed up enough with the topic to call it complete BS on the spot. Please help me stop the community at large from saying this, because it really isn't true at all.</div><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra">-Mark</div></div></div></div><span class="">
______________________________<u></u>_________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org" target="_blank">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" target="_blank">https://mail.python.org/<u></u>mailman/listinfo/python-dev</a><br></span>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/brett%40python.org" target="_blank">https://mail.python.org/<u></u>mailman/options/python-dev/<u></u>brett%40python.org</a><br>
</blockquote></div>
</blockquote></div></div>