[pypy-dev] std objectspace interface

Stephan Diehl stephan.diehl at gmx.net
Fri Apr 7 18:16:39 CEST 2006


Hallo all,

I have a question about the standard objectspace interface.
It's about how to best return an iterator.
While writing the 'set' implementation, it occured to me, that I'm using a 
W_SeqIterObject directly, which is bad, since this breaks the intended 
separation of types / objects. 
Instead, I'd like to use something like
space.newseqiter. But 'newseqiter' takes a wrapped object, while I'd rather 
use a way to 'translate' some interp level iterator of wrapped objects 
directly to an application lever iterator.
This would be similar to newlist which creates an application level list of 
application level objects out of an interp level list of application level 
objects.

Or is the dictobject way the preferred one? There we have special iterator 
object 'W_DictIter_Keys', for example.

I hope I make a bit of sense.

Cheers

Stephan



More information about the Pypy-dev mailing list