Re: Moving object on page leaves afterimage on Python 3 but not on 2

Reinis Danne <[email protected]>
Newsgroups gmane.comp.python.tkinter
Message-ID <[email protected]>
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
[email protected]
https://mail.python.org/mailman/listinfo/tkinter-discuss
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.