This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tim.peters
Recipients docs@python, rhettinger, tim.peters
Date 2018-02-06.02:08:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1517882881.56.0.467229070634.issue32767@psf.upfronthosting.co.za>
In-reply-to
Content
Some other points to consider:  I don't think this belongs in the `for` statement docs at all.  Instead they should merely _note_ that what happens if a sequence being iterated over is mutated is up to the sequence iterator.

Then, e.g., the `list` docs should spell out the behavior currently (but, as already noted, incompletely) described.  From StackOverflow experience, I may be the only person in the world who knows that list behavior here is documented under the `for` statement - everyone else gives up after not finding a word about it in the `list` docs ;-)

`collections.deque` docs, in contrast, may wish to document the behavior of its iterators.  They in fact work hard to raise an exception if a size-changing mutation occurs during iteration, but that doesn't appear to be documented.  It's worth debating whether it should be.

Are there other mutable sequence types in the standard distribution?
History
Date User Action Args
2018-02-06 02:08:01tim.peterssetrecipients: + tim.peters, rhettinger, docs@python
2018-02-06 02:08:01tim.peterssetmessageid: <1517882881.56.0.467229070634.issue32767@psf.upfronthosting.co.za>
2018-02-06 02:08:01tim.peterslinkissue32767 messages
2018-02-06 02:08:00tim.peterscreate