Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #4642 > unrolled thread

Re: Pickling extension types

Started byRobert Kern <robert.kern@gmail.com>
First post2011-05-04 13:30 -0500
Last post2011-05-04 13:30 -0500
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Pickling extension types Robert Kern <robert.kern@gmail.com> - 2011-05-04 13:30 -0500

#4642 — Re: Pickling extension types

FromRobert Kern <robert.kern@gmail.com>
Date2011-05-04 13:30 -0500
SubjectRe: Pickling extension types
Message-ID<mailman.1164.1304533849.9059.python-list@python.org>
On 5/4/11 10:45 AM, Stefan Kuzminski wrote:
> I got this to work by returning from reduce just the args that the __init__ of
> the type being pickled requires ( rather than the 5 length tuple described in
> the pickling docs ), I am not going to argue with it though..

Let's take a step back. The documentation says to return a tuple between 2 and 5 
elements long. You can omit the optional ones or use Nones in their place. The 
original code you posted allocated a 5-tuple, but did not insert anything into 
positions 2, 3, or 4. This was an error. You should have returned a 2-tuple of 
the type object in the 0-index slot and the argument tuple in the 1-index slot. 
Are you saying that you just returned the argument tuple? I don't think that 
would work.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web