[ZODB-Dev] Storage iterators and IndexError

Christian Theune ct at gocept.com
Sat May 15 06:43:07 EDT 2010


On 05/14/2010 08:43 PM, Jim Fulton wrote:
> The file storage iterator was implemented before Python had iterators.
> (Actually, Python previously had an iterator based on a corner
> of the sequence protocol, which FileStorage used.)
>
> There's a test for storage iterators that verifies that they raise
> a special exception that extends StopIteration and IndexError.
> This makes storage iterators a bit harder to implement than
> necessary.
>
> Does anyone know of a reason why we should have to raise
> a special error that raises IndexErrors?

My first thought was backwards compatibility to something and the 
docstring of the StorageStopIteration says so but doesn't tall for what.

Sounds like support for old clients but I can't say for which use case.

Christian

-- 
Christian Theune · ct at gocept.com
gocept gmbh & co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 0 · fax +49 345 1229889 1
Zope and Plone consulting and development



More information about the ZODB-Dev mailing list