
May 24, 2021
2:34 p.m.
On Mon, May 24, 2021 at 4:10 AM MRAB <python@mrabarnett.plus.com> wrote:
On 2021-05-24 01:37, Luciano Ramalho wrote:
Now I can use NotGiven as the sentinel, and its default repr is <NotGiven>.
The repr of other singletons are the names of those singletons, eg. "None", so why "<NotGiven>" instead of "NotGiven"?
Yea, that's up in the air. The common suggestions are either "NotGiven", "<NotGiven>" or "mymodule.NotGiven". The first makes sense for builtins like None and Ellipses, but I'm not sure a function signature like foo(bar=NotGiven) is very clear. With the factory function pattern there's no need for a default, so this may become a non-issue, and I may remove the recommendation for which form to use. - Tal