Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PEP 671: Since it keeps getting asked about, add a para on deferreds #2661

Merged
merged 1 commit into from
Jun 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion pep-0671.rst
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ While this does not completely explain all the subtleties, it is sufficient to
cover the important distinction here (and the fact that they are similar).


Interaction with other open PEPs
Interaction with other proposals
================================

:pep:`661` attempts to solve one of the same problems as this does. It seeks to
Expand All @@ -141,6 +141,16 @@ 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.

A generic system for deferred evaluation has been proposed at times (not to be
confused with :pep:`563` and :pep:`649` which are specific to annotations).
While it may seem, on the surface, that late-bound argument defaults are of a
similar nature, they are in fact unrelated and orthogonal ideas, and both could
be of value to the language. The acceptance or rejection of this proposal would
not affect the viability of a deferred evaluation proposal, and vice versa. (A
key difference between generalized deferred evaluation and argument defaults is
that argument defaults will always and only be evaluated as the function begins
executing, whereas deferred expressions would only be realized upon reference.)


Implementation details
======================
Expand Down