On Fri, Feb 05, 2016 at 05:03:50PM +0100, Michael Lange wrote:
> 
> Personally I hardly ever use map(), so I never noticed that. In fact this
> change is actually documented, see
> https://docs.python.org/3.0/whatsnew/3.0.html#views-and-iterators-instead-of-lists
>  :
> 
> "map() and filter() return iterators. If you really need a list, a quick
> fix is e.g. list(map(...)), but a better fix is often to use a list
> comprehension (especially when the original code uses lambda), or
> rewriting the code so it doesn’t need a list at all. Particularly tricky
> is map() invoked for the side effects of the function; the correct
> transformation is to use a regular for loop "
> 
> Not sure what's the use of these map objects, in Python3 now you can call
> the map object's __next__() method to iterate.
> But for your purpose certainly the for loop is the way to go.
> 
> Best regards
> 
> Michael

Thanks, that clears it up. Somehow I had missed this.


Reinis
_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss@python.org
https://mail.python.org/mailman/listinfo/tkinter-discuss

Reply via email to