Peter Otten added the comment: >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 ;) ---------- nosy: +peter.otten Added file: http://bugs.python.org/file34256/pickle_sentinels.py _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue20804> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com