Re: [Python-Dev] Python 2.x and 3.x use survey, 2014 edition

2014年12月16日 11:45:01 -0800

On 2014年12月16日 19:25:35 +0000
Brett Cannon <[email protected]> wrote:
> 
> As for the changing of the default in Python 3, that's because we decided
> to make iterators the default everywhere. And that was mostly for
> consistency, not performance reasons. It was also for flexibility as you
> can go from an iterator to a list by just wrapping the iterator in list(),
> but you can't go the other way around.
And two other reasons:
- the API becomes simpler to use as there's no need to choose
 between .items() and .iteritems(), etc.
- the 3.x methods don't return iterators but views, which have set-like
 features in addition to basic iterating
Regards
Antoine.
_______________________________________________
Python-Dev mailing list
[email protected]
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