Message212460
| Author |
peter.otten |
| Recipients |
Vlastimil.Zíma, michael.foord, peter.otten, r.david.murray |
| Date |
2014年02月28日.17:00:53 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1393606854.1.0.906772975008.issue20804@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
From looking at the sentinel code it appears a sentinel's identity is controlled by its name alone, i. e.
sentinel.foo is sentinel.foo
If that's the desired behaviour it is well possible to make that indentity survive pickling. I have attached a demo script using the simplest approach -- registering the class with copyreg.
If you like the general idea I'm willing to look up the alternative (a __getstate__() or __reduce__() method), too ;) |
|