[Patches] protection for marshalling recursive data structures

Guido van Rossum guido@beopen.com
Wed, 28 Jun 2000 10:27:16 -0500


> 1. Your solution (lightweight) based on a fixed watermark value without
>    effectively detecting cyclic references
> 2. Detect cyclic objects and reject them by raising an exception
> 3. Detect cyclic objects and accept them by introducing a new marshal
>    type code 'o' just like pickle does.
> 
> #2 & #3 are more heavy as they require tracking the currently marshalled
> objects in a dict (or a list). A priori, #3 is out of scope as it does too
> much and overlaps pickle.
> 
> So my guess is that Guido has to decide which one he prefers (#1 or #2).
> If you're not Guido, you may want to chime in too with an opinion.
> 
> #2 hasn't been posted anywhere as I waited for Guido's response...

I'm for the lightweight #1...

--Guido van Rossum (home page: http://www.python.org/~guido/)