[Tkinter-discuss] Moving object on page leaves afterimage on Python 3 but not on 2

Reinis Danne rei4dan at gmail.com
Fri Feb 5 12:29:43 EST 2016


On Fri, Feb 05, 2016 at 10:03:51PM +0530, Bhaskar Chaudhary wrote:
> Hi Reinis Danne
> 
> I am not sure if this is exactly the cause of your problem, but
> map() returns a list in Python 2 but an iterator  in Python 3.
> 
> You can place a list around map() like:
>    list(map(self.paper.delete, items))
> to ensure that the result is still a list and has the same behavior in
> both Python 2 and 3.
> 
> Another difference is that in Python 2 map() continues until the items
> in the longest of the iterator is exhausted, extending the other
> arguments with None. In Python 3 this is not the case, a similar
> behavior can be achieved using itertools.zip_longest.
> 
> So I guess, your problem is related to one of the above two issues.
> 
> BTW, really nice program there you have built.

Thanks! But I'm only a lowly maintainer and porting to Python 3.
The credit for writing BKChem goes to Beda Kosata.


Reinis


More information about the Tkinter-discuss mailing list