This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients Vlastimil.Zíma, davin, michael.foord, peter.otten, r.david.murray, serhiy.storchaka
Date 2017-01-11.10:27:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1484130445.04.0.80046099466.issue20804@psf.upfronthosting.co.za>
In-reply-to
Content
I just don't know well the purpose of sentinels, and don't . I see fourth possible options:

1. Raise an exception when copy or pickle a sentinel. This is an option when we want to be sure that copying and pickling are not involved and we get the same object as passed.

2. Create an unique sentinel with unique unambiguous name when copy or unpickle a sentinel. This is a behavior of commonly used sentinels (object(), ['sentinel'], etc), and current behavior of mock.sentinel (except that the name is left the same and this is confusing).

3. Preserve identity when copy or pickle/unpickle a sentinel. This is an option when test a function that uses multiprocessing or persistent cache and should restore an equivalent object. This is a behavior of enums, classes, functions or other global named objects.

4. Preserve equality but not identity when copy or pickle/unpickle a sentinel. This is similar to the third option.

All options look reasonable to me. I don't know what case is more common, what behavior is more expectable.
History
Date User Action Args
2017-01-11 10:27:25serhiy.storchakasetrecipients: + serhiy.storchaka, peter.otten, r.david.murray, michael.foord, Vlastimil.Zíma, davin
2017-01-11 10:27:25serhiy.storchakasetmessageid: <1484130445.04.0.80046099466.issue20804@psf.upfronthosting.co.za>
2017-01-11 10:27:25serhiy.storchakalinkissue20804 messages
2017-01-11 10:27:24serhiy.storchakacreate