On Lists and Iterables

John Lenton john.lenton at canonical.com
Fri Dec 15 12:02:34 UTC 2017


On 15 December 2017 at 10:40, Xen <list at xenhideout.nl> wrote:
>
> Zipping by definition produces a list of tuples

No it's not.

That's how it was defined in python 2, yes. The definition changed for
3. This is _more_ friendly, because in 2 you could very easily
inadvertently use up a lot more memory than you were wanting to. If
all you wanted was to loop over things, zip (and dict's keys and
values and items, and range) now do the right thing. If you actually
wanted the list you pass it to list(), and make your wants explicit.




More information about the Ubuntu-devel-discuss mailing list