PEP 671: Mention PEP 661, which solves some of the same problems

This commit is contained in:
Chris Angelico 2021-10-24 22:48:56 +11:00
parent 3d9f9b2e98
commit e61f18a104
1 changed files with 14 additions and 0 deletions

View File

@ -109,6 +109,20 @@ bound arguments are broadly equivalent to code at the top of the function::
if target was omitted: target = []
Interaction with other open PEPs
================================
PEP 661 attempts to solve one of the same problems as this does. It seeks to
improve the documentation of sentinel values in default arguments, where this
proposal seeks to remove the need for sentinels in many common cases. PEP 661
is able to improve documentation in arbitrarily complicated functions (it
cites ``traceback.print_exception`` as its primary motivation, which has two
arguments which must both-or-neither be specified); on the other hand, many
of the common cases would no longer need sentinels if the true default could
be defined by the function. Additionally, dedicated sentinel objects can be
used as dictionary lookup keys, where PEP 671 does not apply.
Open Issues
===========