This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients habnabit, jcea, pitrou
Date 2008-07-02.21:10:03
SpamBayes Score 0.0003343244
Marked as misclassified No
Message-id <1215032998.5989.17.camel@fsol>
In-reply-to <1215031433.43.0.601447838555.issue3119@psf.upfronthosting.co.za>
Content
Hi,

Le mercredi 02 juillet 2008 à 20:43 +0000, Aaron Gallagher a écrit :
> Aaron Gallagher <habnabit@gmail.com> added the comment:
> 
> Ah, I didn't know that a list would be as fast for appending and popping. 
> I knew that lists were optimized for .append() and .pop(), but I didn't 
> know that a list would be just as fast as a deque if it was just used as a 
> stack.

If you have a few minutes to spare, the best would be to measure the
speed of both possibilities, and opt for the fastest. 

> And I'll be happy to write unit tests if it can be pointed out to me how 
> exactly they can be written. Should it just test to make sure pickling a 
> deeply nested object hierarchy can be pickled without raising a 
> RuntimeError?

Yes, exactly. Just create a very deeply nested object (a list should be
sufficient I suppose), pickle it, unpickle it, and check that the result
is equal to the original. No need to do more. Don't bother catching the
eventual RuntimeError, if it is raised the test will be failed anyway.

Since your patch only regards the pickle module (not cPickle) I suppose
the test could go directly into Lib/test/test_pickle.py.

(oh and don't forget to check the test case fails without your
patch :-))

Thanks !
History
Date User Action Args
2008-07-02 21:10:05pitrousetspambayes_score: 0.000334324 -> 0.0003343244
recipients: + pitrou, jcea, habnabit
2008-07-02 21:10:04pitroulinkissue3119 messages
2008-07-02 21:10:03pitroucreate