[Python-Dev] More data points (original) (raw)

ncoghlan at iinet.net.au ncoghlan at iinet.net.au
Sun Sep 26 08:22:02 CEST 2004


Quoting Tim Peters <tim.peters at gmail.com>:

That's because they never suffered from list's ill-advised documentation effectively blessing mutation while iterating <0.5_ _wink>.

Ah. Interesting to know. So catching this is recommended when it's feasible?

> Set throws the same exception as dictionary does (presumably, the main > container inside 'set' is a dictionary) > > Details of behaviour:

The last one is extremely surprising:

And it never actually happened, either. It's a transcription error on my part. I made a mistake when testing the dict.update version (I wrote "-y for y in x", instead of "(-y, None) for y in x"). When deleting that from the transcript, I also accidentally deleted the x.fromkeys() example. When I added that example back in, I put it in the wrong spot (after the x.update example, instead of before it).

So, no, dict.update isn't randomly eating dictionary entries. Sorry 'bout the false alarm. . .

Cheers, Nick.



More information about the Python-Dev mailing list