[New-bugs-announce] [issue46095] Warning about iterate/modify has unwarranted detail

Ture Pålsson report at bugs.python.org
Thu Dec 16 04:48:01 EST 2021


New submission from Ture Pålsson <ture at turepalsson.se>:

The language reference about the 'for' statement (https://docs.python.org/3/reference/compound_stmts.html#the-for-statement) has a "Note" box that states that the for statement uses an "internal counter" which is "incremented", and goes into detail about what happens when modifications happen before or after the current loop position. Surely this depends on the underlying iterator? For example, with a balanced tree an insert or a delete could completely re-jigger the tree with hard-to-predict results on an iterator.

----------
assignee: docs at python
components: Documentation
messages: 408680
nosy: docs at python, turepalsson
priority: normal
severity: normal
status: open
title: Warning about iterate/modify has unwarranted detail
type: enhancement
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46095>
_______________________________________


More information about the New-bugs-announce mailing list