On Wed, Dec 1, 2021 at 10:12 AM Chris Angelico email@example.com wrote:
On Thu, Dec 2, 2021 at 12:42 AM David Mertz, Ph.D. firstname.lastname@example.org wrote:
- If "no" to question 1, is there some other spelling or other small
change that WOULD mean you would use it? (Some examples in the PEP.)
Yes, the delay/later/defer keyword approach is not confusing, and does
not preempt a later feature that would actually be worth having.
Do you mean changing the spelling of the existing proposal, or a completely different proposal for deferred objects that are actually objects? Because that is NOT what I mean by a "small change". :)
The spelling of the existing proposal. I.e. if the proposal were:
def fun(things: list[int] = defer ) -> int: # ... some implementation
I'd be -0 on the idea rather than -100.
Yes, my change in attitude is largely because I want *some future PEP* to address the more general situation like:
result = defer really_expensive_calculation() if predicate: doubled = result * 2
But I do not think your PEP does (nor even should) include that potential future behavior/syntax. Such a hypothetical future PEP would have a continuity with the syntax of your feature, albeit DEFINITELY need to address many independent concerns/issues that yours does not create.
However, even if I assume the mythical future PEP never happens, in terms of readability, a WORD is vastly less confusing than a combination of punctuation that has no obvious or natural interpretation like '=>'. Or rather, I think that spelling is kinda-sorta obvious for the lambda meaning, and the use you want is kinda-sorta similar to a lambda. So I *do* understand how you get there... but it still seems like much too much line noise for a very minimal need.