From 46a1c9ceb8bb1794467698e1c350fa5e5cf5cce0 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Tue, 28 Jun 2005 08:46:39 +0000 Subject: [PATCH] Add comments to 323. --- pep-0323.txt | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pep-0323.txt b/pep-0323.txt index ea0ffd8cc..8b5d22957 100644 --- a/pep-0323.txt +++ b/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