[Web-SIG] Iterator protocols.

Phillip J. Eby pje at telecommunity.com
Tue Aug 31 17:47:51 CEST 2004


At 04:16 PM 8/31/04 +0100, Alan Kennedy wrote:
>[Phillip J. Eby]
> > And such code, if it has an iterable at all, is
> > going to be written to the old iterator protocol, because it will
> > presumably want to be able to run in pre-2.2 CPython containers, too.
>
>Well, as I mentioned above, I will attempt to explicitly support both the 
>old and new iterator protocols.
>
>Do you think other folks developing embedded (i.e. not coded in python) 
>frameworks should consider the same?

I don't think this is going to be an issue anywhere else; AFAIK any other 
non-CPython target will have 2.2 iterator support built-in.  For CPython 
2.2 and up, 'PyObject_GetIter()' will do.  If somebody needs to support 
earlier versions, they should just implement the old iterator protocol.  It 
doesn't make any sense to try to support CPython 2.1 objects implementing a 
CPython 2.2 protocol, the special case of Jython notwithstanding.



More information about the Web-SIG mailing list