|
From: <bc...@wo...> - 2002-01-06 21:34:51
|
Hi,
In the last bunch of iterator related checkins, I have not added any
backward compatibility for existing PyObject subclasses that uses the
__finditem__ protocol to support looping.
As much as I would like to forget about this kind of backward
compatibility, I don't honestly believe I can get away with it.
Right now, a PyObject subclass *must* implement the __iter__ protocol if
it wish to participate in a sequence operation. If the subclass already
defines __finditem__, it can support the new __iter__ protocol by adding
a method like this:
public PyObject __iter__() {
return new PySequenceIter(this);
}
I would like some suggestions on how we can stay backward compatible on
the API protocol level, without putting too big a burden on new PyObject
subclasses.
regards,
finn
|