[Python-Dev] Re: The repr of a sentinel

2021年5月13日 02:26:39 -0700

On 2021年5月13日 10:15:03 +0100
Irit Katriel via Python-Dev <[email protected]> wrote:
> Following a recent change, we now have in traceback.py:
> 
> _sentinel = object()
> def print_exception(exc, /, value=_sentinel, tb=_sentinel, limit=None,
> file=None, chain=True):
> 
> So now:
> 
> >>> import traceback
> >>> help(traceback.print_exception) 
> Help on function print_exception in module traceback:
> 
> print_exception(exc, /, value=<object object at
> 0x000002825DF09650>, tb=<object object at 0x000002825DF09650>, 
> limit=None, file=None, chain=True)
> 
> 
> Is there a convention on how such default sentinel values should appear in
> docs?
If this were a positional-only argument, you could use square brackets,
e.g.:
 print_exception(exc[, value[, ...]])
Other than that, I can't think of any existing convention. I agree
that <optional> is a reasonable spelling.
Regards
Antoine.
_______________________________________________
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/EJXKQJM7COQFIPPSQGH5O3IAFPUKYWGL/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to