classification
Title: improve signature (in help, etc) for functions taking sentinel defaults
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.11, Python 3.10
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: ZackerySpytz, iritkatriel, miss-islington, pablogsal
Priority: normal Keywords: 3.10regression, patch

Created on 2021-01-25 15:03 by iritkatriel, last changed 2021-06-17 16:42 by iritkatriel. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 24331 merged iritkatriel, 2021-01-25 15:05
PR 26773 merged miss-islington, 2021-06-17 16:14
Messages (5)
msg385636 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-01-25 15:14
The "sentinel" default value don't render nicely in the signature:

>>> 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)
msg385637 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-01-25 15:14
The PR changes the output to:

>>> help(traceback.print_exception)
Help on function print_exception in module traceback:

print_exception(exc, /, value=<optional>, tb=<optional>, limit=None, file=None, chain=True)
msg389973 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-04-01 11:27
Marking as a 3.10 regression because the sentinel was added in 3.10.
msg396010 - (view) Author: miss-islington (miss-islington) Date: 2021-06-17 16:14
New changeset f73377d57c5272390de63cccc3c292c44689310a by Irit Katriel in branch 'main':
bpo-43024: improve signature (in help, etc) for functions taking sent… (GH-24331)
https://github.com/python/cpython/commit/f73377d57c5272390de63cccc3c292c44689310a
msg396011 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-06-17 16:42
New changeset eb0a6801bef4f68eebf6fdb2b7a32c32a5b6c983 by Miss Islington (bot) in branch '3.10':
bpo-43024: improve signature (in help, etc) for functions taking sent… (GH-24331) (GH-26773)
https://github.com/python/cpython/commit/eb0a6801bef4f68eebf6fdb2b7a32c32a5b6c983
History
Date User Action Args
2021-06-17 16:42:40iritkatrielsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2021-06-17 16:42:04iritkatrielsetmessages: + msg396011
2021-06-17 16:14:40miss-islingtonsetpull_requests: + pull_request25359
2021-06-17 16:14:37miss-islingtonsetnosy: + miss-islington
messages: + msg396010
2021-06-17 11:47:59iritkatrielsetversions: + Python 3.11
2021-04-01 11:27:17iritkatrielsetkeywords: + 3.10regression

messages: + msg389973
2021-01-26 18:15:16iritkatrielsetnosy: + ZackerySpytz, pablogsal
2021-01-25 15:14:23iritkatrielsetmessages: + msg385637
2021-01-25 15:14:00iritkatrielsetmessages: + msg385636
2021-01-25 15:13:07iritkatrielset -> (no value)
messages: - msg385635
2021-01-25 15:13:02iritkatrielsetmessages: - msg385634
2021-01-25 15:07:11iritkatrielsetmessages: + msg385635
2021-01-25 15:05:24iritkatrielsetkeywords: + patch
stage: patch review
pull_requests: + pull_request23150
2021-01-25 15:03:28iritkatrielsettype: enhancement
2021-01-25 15:03:19iritkatrielcreate