Re: "dictionary changed size during iteration" error in Python 3 but not in Python 2

2020-08-23 Thread Peter Otten
Chris Green wrote: >> >1 - Why doesn't it error in Python 2? >> >> The dict internal implementation has changed. I don't know the >> specifics, but it is now faster and maybe smaller and also now preserves >> insert order. >> > Ah, that probably explains it then. But if you try to modify a dict

Re: "dictionary changed size during iteration" error in Python 3 but not in Python 2

2020-08-23 Thread Chris Green
Cameron Simpson wrote: > On 23Aug2020 10:00, Chris Green wrote: > >I have a (fairly) simple little program that removes old mail messages > >from my junk folder. I have just tried to upgrade it from Python 2 to > >Python 3 and now, when it finds any message[s] to delete it produces > >the error:

Re: "dictionary changed size during iteration" error in Python 3 but not in Python 2

2020-08-23 Thread Cameron Simpson
On 23Aug2020 10:00, Chris Green wrote: >I have a (fairly) simple little program that removes old mail messages >from my junk folder. I have just tried to upgrade it from Python 2 to >Python 3 and now, when it finds any message[s] to delete it produces >the error:- > >RuntimeError: dictionary

"dictionary changed size during iteration" error in Python 3 but not in Python 2

2020-08-23 Thread Chris Green
I have a (fairly) simple little program that removes old mail messages from my junk folder. I have just tried to upgrade it from Python 2 to Python 3 and now, when it finds any message[s] to delete it produces the error:- RuntimeError: dictionary changed size during iteration I can sort of s