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

Vlastimil Zíma report at bugs.python.org
Wed Jan 11 04:11:58 EST 2017


Vlastimil Zíma added the comment:

Since the issue was dug up, I've created a patch for documentation.

I still think, that it is worth stating the equality is not preserved for sentinels when copied as the message produced by tests is rather confusing:

    class SentinelTestCase(TestCase):
        def test_sentinel(self):
            self.assertEqual(sentinel.foo, copy(sentinel.foo))
            # AssertionError: sentinel.foo != sentinel.foo

----------
Added file: http://bugs.python.org/file46253/sentinel-doc.patch

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


More information about the Python-bugs-list mailing list