Dom Grigonis writes:

 > The thing I am not content with (to make it common practice in my
 > coding style) is inconsistencies between a) order of terms
 > and b) functionality, of statements and their analogous
 > expressions.

I think that's reasonable.  But I don't think Python is the language
for that.  There are too much existing contrasts, such as loop vs.
comprehension and conditional statement vs. ternary expression.  Guido
deliberately chose to vary those expression syntaxes from their
statement equivalents.  I don't think there's any ambiguity if you say
that wrapping a compound statement in parentheses creates an
expression with restricted syntax (namely, the statements the syntax
controls become expressions):

    (if condition_1: expression_1
     elif condition_2: expression_2
     else: expression_else)

    [for element in iterable: if condition: expression(element)]

But Guido (and I think everybody else) thought "Noooo! not *that*!"

 > ??????????
 >  `Deferred evaluation`, if was to gain traction in a similar manner
 >  as e.g. `annotations` are now experiencing, would cover all of the
 >  cases I was looking at & more.

As Chris was saying earlier, it's at minimum going to take some genius
creativity to "cover all and more", because a closer look at what
people mean by "deferred" shows that in different cases it is
semantically different.  In particular, there are a number of choices
that Chris made in PEP 671 that aren't compatible with several of the
proposals for Deferred objectss, while Deferreds can't give some of
the benefits of the PEP.

I didn't like that PEP then; I was in the camp of "let's get genuine
Deferreds, and use them to cover some of the use cases for PEP 671."
I don't actively want the PEP now.  def-time evaluation of defaults
doesn't catch me and I haven't had trouble teaching it.  The
"if arg is None: arg = Mutable()" idiom is rare enough that I prefer
it to adding syntax to the already complex function prototype.

But if you think it might be a good idea, I encourage you to take a
close look.  For some use cases it's definitely an improvement, and at
least I won't vocally oppose the PEP now -- haven't seen any progress
on "true Deferreds".  Perhaps others' opposition has softened, too.
Adding another proponent is another way to help get it going again.

Steve

_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/R5RDLOSEBPEQQ5BLECV7HPKZAX6HYSM2/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to