> -----Original Message-----
> From: Python-Dev [mailto:python-dev-
> bounces+kristjan=ccpgames....@python.org] On Behalf Of Steven
> D'Aprano
> If this is a cunning plan to make Nick's suggestion sound better by suggesting
> an even worse alternative, it's working :-)

You got me.
However, I also admit to having learned something today from the PEP.  That 
2to3 actually replaces d.iteritems() with iter(d.items()).
In all my porting experience this conservative approach is redundant for my use 
cases which is usally just immediate iteration, so I have successfully replaced 
d.iteritems() with d.items() without issue.  For polyglot code, with rare 
exceptions simply using d.items() in both places is good enough, since IMHO the 
ill effects of creating temporary list objects is somewhat overstated.

The PEP however explicitly wants to do it "correctly" because testing is often 
limited.  So I withdraw my suggestion :)

K
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to