Indeed (I had forgotten this already...):

------------------------------------------------------------------------
r36256 | rwgk | 2006-12-03 12:43:48 -0800 (Sun, 03 Dec 2006) | 2 lines

fixes to support pickling of enums (by Shashank Bapat)

------------------------------------------------------------------------


And there is this test (boost/libs/python/test/enum.py):

# pickling of enums only works with Python 2.3 or higher
exercise_pickling = '''
>>> import pickle
>>> p = pickle.dumps(color.green, pickle.HIGHEST_PROTOCOL)
>>> l = pickle.loads(p)
>>> identity(l)
enum_ext.color.green
'''

So this is supposed to work.



----- Original Message ----
From: Hans Meine <[EMAIL PROTECTED]>
To: Development of Python/C++ integration <cplusplus-sig@python.org>
Cc: Ralf W. Grosse-Kunstleve <[EMAIL PROTECTED]>
Sent: Tuesday, December 9, 2008 4:40:17 AM
Subject: Re: [C++-sig] Pickle an enum from c++

On Monday 08 December 2008 20:02:41 Roman Yakovenko wrote:
> 2008/12/8 Matthew Scouten (TT) <[EMAIL PROTECTED]>:
> > From the lack of response I assume that no one has any clever ideas to
> > make an enum pickleable.  Thank you to anyone who put thought into this.
> >
> :-).
>
> I thought about work around: you can define your enums in Python. May
> be youcan add this functionality from Python?
>
> Also did you see the following discussion?
> http://mail.python.org/pipermail/cplusplus-sig/2006-November/011372.html

Oh, this is continued here:
http://mail.python.org/pipermail/cplusplus-sig/2006-November/011376.html

Looks like there was a solution in 2006; Ralf even wanted to have a test case 
for check-in.  Ralf, did you receive stuff from Shashank back then?  (Or did 
you wait until today with committing the fix?)

Greetings,
  Hans

_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig

Reply via email to