[issue20804] Sentinels identity lost when pickled (unittest.mock)

Michael Foord report at bugs.python.org
Mon Mar 3 13:28:26 CET 2014


Michael Foord added the comment:

I'm not sure to what extent mock documentation should explain Python semantics. The docs *do* make clear that sentinel is useful for where you want to test (compare) objects by *identity*. Problems with copying and pickling them come from the fact that those operations don't preserve *identity*, which is a basic facet of *Python* and not down to mock/sentinel.

"sentinel provides a convenient way of creating and testing the identity of objects like this."

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20804>
_______________________________________


More information about the Python-bugs-list mailing list