[issue16225] add to "looping techniques" tutorial a note about modifying sequence

2012-10-15 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Committed.  Thanks for reporting the suggestion, Ian.

--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16225] add to "looping techniques" tutorial a note about modifying sequence

2012-10-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset dc006b6212e7 by Chris Jerdonek in branch '2.7':
Issue #16225: Backport from 3.2: Add additional note to tutorial about looping.
http://hg.python.org/cpython/rev/dc006b6212e7

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16225] add to "looping techniques" tutorial a note about modifying sequence

2012-10-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1f1bf6a3abbc by Chris Jerdonek in branch '3.2':
Issue #16225: Add additional note to tutorial about changing sequence while 
looping.
http://hg.python.org/cpython/rev/1f1bf6a3abbc

New changeset 8cb14494d33c by Chris Jerdonek in branch '3.3':
Issue #16225: Merge from 3.2: Add additional note to tutorial about looping.
http://hg.python.org/cpython/rev/8cb14494d33c

New changeset e0a407d41af5 by Chris Jerdonek in branch 'default':
Issue #16225: Merge from 3.3: Add additional note to tutorial about looping.
http://hg.python.org/cpython/rev/e0a407d41af5

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16225] add to "looping techniques" tutorial a note about modifying sequence

2012-10-15 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Thanks, Raymond.  I will be doing that later today.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16225] add to "looping techniques" tutorial a note about modifying sequence

2012-10-15 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> > It will be nice somewhere in deep clarify 
> > for experts what happens with list iterator if the list changed.

Resist the urge to over-specify.  Unless the behavior is tested and known to be 
consistent across all implementations, I'm content with the current docs:

"Note There is a subtlety when the sequence is being modified by the loop"

Chris's currently patch seems reasonable to me and I don't think anything 
further is a good idea.

With nearly any data structure in any language, most programmers learn to be 
cautious about and generally avoid looping over a structure while mutating it.  
Adding yet more documentation details won't make the issue go away.

I recommend posting the current patch and closing this issue to be done with it.

--
nosy: +rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16225] add to "looping techniques" tutorial a note about modifying sequence

2012-10-15 Thread Chris Jerdonek

Changes by Chris Jerdonek :


--
title: list.remove in for loop -> add to "looping techniques" tutorial a note 
about modifying sequence
type:  -> enhancement
versions: +Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com