[Stackless] Stackless 2.3 CVS on OS X, test failures

Bob Ippolito bob at redivi.com
Sun Jan 25 17:24:31 CET 2004


On Jan 25, 2004, at 7:06 AM, Christian Tismer wrote:

> Bob Ippolito wrote:
>> On Jan 25, 2004, at 5:11 AM, Bob Ippolito wrote:
>>> [crack:stackless/Stackless/test] bob% stackless test_pickle.py
>>> ....
>>>   File "/usr/experimental/lib/python2.3/copy_reg.py", line 69, in 
>>> _reduce_ex
>>>     raise TypeError, "can't pickle %s objects" % base.__name__
>>> TypeError: can't pickle listiterator objects
>> Obviously these are a Python problem, and not a Stackless problem.  
>> This is something I could do.. here are the iterators that probably 
>> should be taken care of (off the top of my head):
>>     listiterator
>>     tupleiterator
>>     dictionary-iterator
>>     rangeiterator
>>     xrange
>
> This is something that I wanted to do right after getting
> rid of all crashes. Unfortunately that keept me busy since
> two weeks, now, and I'm still hunting one special case.
>
> Adding this pickle support should not be too hard and quite
> straight forward. Have a look at prickelpit.c where almost
> all pickling code lives. There is some support that allows
> to patch the type objects and method tables without patching
> their source code at all, which I prefer, to keep the number of
> patched files as small as possible. (I'm trying to reduce these,
> further).  I guess it would be possible to create a few generic
> functions for all iterators and control them via format strings,
> since they are very similar?

They are not similar, with the exception of listiterator and 
tupleiterator.  This implementation is not well tested (but the code 
doesn't do much, so I can't imagine what I got wrong).

I made a few decisions that I'm not sure about, but they are 
performance not functionality or correctness related (I think).
  * dictionary-iterator makes a list copy of the rest of the iteration 
because it's not possible to determine if it was 
iter(keys|values|items) b/c they're pointers to static functions with 
no symbols.  When reduced, it looks like a PySeqIter_Type starting at 0 
with a list.
  * listiterator makes a slice of the list.  When reduced, it looks like 
a PySeqIter_Type starting at 0 with a list.
  * tupleiterator makes a slice of the tuple.  When reduced, it looks 
like a PySeqIter_Type starting at 0 with a tuple.
  * I had a hard time getting at some of the types (they are private..) 
so I had to create the host object, then make it iter, and snag the 
type off of them.

In any case, patch is attached.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: stackless2.3_iterators.patch
Type: application/octet-stream
Size: 10122 bytes
Desc: not available
URL: <http://www.stackless.com/pipermail/stackless/attachments/20040125/a624dc73/attachment.obj>
-------------- next part --------------


-bob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2357 bytes
Desc: not available
URL: <http://www.stackless.com/pipermail/stackless/attachments/20040125/a624dc73/attachment.bin>
-------------- next part --------------
_______________________________________________
Stackless mailing list
Stackless at stackless.com
http://www.stackless.com/mailman/listinfo/stackless


More information about the Stackless mailing list