<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Fri, 6 Jul 2018 at 09:24 Eric V. Smith <<a href="mailto:eric@trueblade.com">eric@trueblade.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 7/6/2018 11:20 AM, Flavio Curella wrote:<br>
> I think this thread can be resolved as 'used unittest.mock.sentinel'. It <br>
> doesn't have 'global sentinels', but I'm not convinced they are actually <br>
> necessary, since `mock.sentinel` objects with the same name compare as <br>
> equal. Thanks to Nathaniel, I now understand that JS has global symbols <br>
> for historical reasons that we don't have, and I'm not convinced of <br>
> their usefulness.<br>
<br>
Do all Python distributions ship with unittest.mock? I see to recall <br>
that Debian and/or Ubuntu strips out part of the normal distribution.<br></blockquote><div><br></div><div>It's usually tkinter and such, not unittest stuff from my understanding.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
For example, dataclasses.py has a sentinel, and it includes some code to <br>
get a more helpful repr. It would make sense to re-use the <br>
unittest.mock.sentinel code, but not if that code isn't always <br>
guaranteed to be present.<br></blockquote><div><br></div><div>Would it make sense to abstract this out to the 'types'  to have a single 'types.sentinel' object for those rare cases that Guido pointed out?<br></div></div></div>