Re: pickling a subclass of tuple

2005-01-01 Thread Alex Martelli
fedor <[EMAIL PROTECTED]> wrote: > Hi all, happy new year, > > I was trying to pickle a instance of a subclass of a tuple when I ran > into a problem. Pickling doesn't work with HIGHEST_PROTOCOL. How should > I rewrite my class so I can pickle it? You're falling afoul of an optimization in pickl

pickling a subclass of tuple

2005-01-01 Thread fedor
Hi all, happy new year, I was trying to pickle a instance of a subclass of a tuple when I ran into a problem. Pickling doesn't work with HIGHEST_PROTOCOL. How should I rewrite my class so I can pickle it? Thanks , Fedor #!/usr/bin/env python import pickle class A(tuple): def __new__(klass, a