New submission from Ture Pålsson <t...@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@python
components: Documentation
messages: 408680
nosy: docs@python, turepalsson
priority: normal
severity: normal
status: open
title: Warning about iterate/modify has unwarranted detail
type: enhancement
versions: Python 3.10

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue46095>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to