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. Advertising

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:
    358
    Martin v. =?iso-8859-15?q?L=F6wis?=
    Sep 11, 2003
  2. harold fellermann

    pickling extension class

    harold fellermann, Jan 18, 2005, in forum: Python
    Replies:
    4
    Views:
    428
    David M. Cooke
    Jan 18, 2005
  3. Gaetan de Menten

    Pickling an extension type subclasses problems

    Gaetan de Menten, Feb 5, 2010, in forum: Python
    Replies:
    0
    Views:
    231
    Gaetan de Menten
    Feb 5, 2010
  4. Littlefield, Tyler
    Replies:
    7
    Views:
    133
    mblume
    Apr 6, 2013
  5. Chris Angelico
    Replies:
    0
    Views:
    120
    Chris Angelico
    Apr 6, 2013
Loading...

Share This Page