On Nov 23, 2010, at 11:52 AM, P.J. Eby wrote: >This reminds me: a stdlib enum should support proper pickling and copying; >i.e.: > > assert SomeEnum.anEnum is pickle.loads(pickle.dumps(SomeEnum.anEnum)) > >This could probably be implemented by adding something like: > > def __reduce__(self): > return getattr, (self._class, self._enumname) > >in the EnumValue class. Excellent idea, thanks. Added to flufl.enum in r38. However, only enums created with the class syntax can be pickled though. Cheers, -Barry -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: not available URL: <http://mail.python.org/pipermail/python-dev/attachments/20101123/4ebdef12/attachment.pgp>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4