iterator.next() confusion

Magnus Lie Hetland mlh at furu.idi.ntnu.no
Sat May 31 11:41:12 EDT 2003


In article <mailman.1054241572.11151.python-list at python.org>, Hans Nowak wrote:
[snip]

>I don't think it has much to do with the PEP.  This behavior is not
>specifically related to iterators, it would be the same with any
>method that you would 'cache' this way and then rebind.

It seems to me that the question was: Why isn't this kind of rebinding
disallowed by the PEP (that is, by the Iterator Protocol)? That way,
caching would be possible/safe (which seems to be what Clark was
after). I don't think he was confused about why the behaviour occurred
:)

Actually, the request seems sort of reasonable to me...

>Cheers,
>
>--Hans

-- 
Magnus Lie Hetland                "In this house we obey the laws of
http://hetland.org                 thermodynamics!"    Homer Simpson




More information about the Python-list mailing list