Add comments to 323.
This commit is contained in:
parent
5af10082b7
commit
46a1c9ceb8
14
pep-0323.txt
14
pep-0323.txt
|
@ -7,7 +7,7 @@ Status: Draft
|
|||
Type: Standards Track
|
||||
Content-Type: text/plain
|
||||
Created: 25-Oct-2003
|
||||
Python-Version: 2.4
|
||||
Python-Version: 2.5
|
||||
Post-History: 29-Oct-2003
|
||||
|
||||
|
||||
|
@ -19,6 +19,18 @@ Abstract
|
|||
might exploit such a __copy__ method when present.
|
||||
|
||||
|
||||
Update and Comments
|
||||
|
||||
Support for __copy__ was included in Py2.4's itertools.tee().
|
||||
|
||||
Adding __copy__ methods to existing iterators will change the
|
||||
behavior under tee(). Currently, the copied iterators remain
|
||||
tied to the original iterator. If the original advances, then
|
||||
so do all of the copies. Good practice is to overwrite the
|
||||
original so that anamolies don't result: a,b=tee(a).
|
||||
Code that doesn't follow that practice may observe a semantic
|
||||
change if a __copy__ method is added to an iterator.
|
||||
|
||||
Motivation
|
||||
|
||||
In Python up to 2.3, most built-in iterator types don't let the user
|
||||
|
|
Loading…
Reference in New Issue