pickling extension types

Discussion in 'Python' started by benevilent@optusnet.com.au, Aug 10, 2004.

  1. Guest

    Hey,

    I am creating an extension type in C for Python, which I want it such
    that instances can be pickled. I basically want the functionality of the
    'object' type such that subclasses of the type which I define, can
    define methods including __getstate__ which will get called on
    pickling/unpickling.

    To do this I need to define the __reduce__ method. The __reduce__ method
    in typeobject.c is exactly what I need for this task. Is there a way to
    reuse this without copy-pasting the code?

    Thanks,
    Laurie
     
    , Aug 10, 2004
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bob
    Replies:
    1
    Views:
    477
    Martin v. =?iso-8859-15?q?L=F6wis?=
    Sep 11, 2003
  2. Anand
    Replies:
    3
    Views:
    1,157
    Tim Daneliuk
    Nov 8, 2003
  3. Christian Seberino
    Replies:
    3
    Views:
    1,402
    Christian Seberino
    Feb 5, 2004
  4. harold fellermann

    pickling extension class

    harold fellermann, Jan 18, 2005, in forum: Python
    Replies:
    4
    Views:
    567
    David M. Cooke
    Jan 18, 2005
  5. Steve
    Replies:
    3
    Views:
    27,699
    Steve
    Aug 25, 2006
  6. Elhanan
    Replies:
    0
    Views:
    698
    Elhanan
    Jan 23, 2007
  7. Gaetan de Menten

    Pickling an extension type subclasses problems

    Gaetan de Menten, Feb 5, 2010, in forum: Python
    Replies:
    0
    Views:
    303
    Gaetan de Menten
    Feb 5, 2010
  8. Littlefield, Tyler
    Replies:
    7
    Views:
    235
    mblume
    Apr 6, 2013
Loading...