slice object unpickable

Sebastien de Menten sdementen at
Wed Nov 3 13:07:46 CET 2004

perfect ! I was not aware of this functionnality. But indeed, in the
python library reference, I should have read the doc of the module
just under cPickle.
thanks a lot

>   Or use the copy_reg module to make them pickleable:
>     def pickleSlice(slice):
>         return unpickleSlice, (slice.start, slice.stop, slice.step)
>     def unpickleSlice(start, stop, step):
>         return slice(start, stop, step)
>     copy_reg.pickle(slice, pickleSlice, unpickleSlice)
>   Jp

More information about the Python-list mailing list