[Python-ideas] Modern language design survey for "assign and compare" statements
apalala at gmail.com
Sun May 20 11:19:37 EDT 2018
On Sun, May 20, 2018 at 1:35 AM, Steven D'Aprano <steve at pearwood.info>
> but maybe when languages are weird enough they all look the same :-)
Look at what happened with PERL...
Enabling "as" in "if" and "while" doesn't have to be at the expense of
some form of assignment expression. We've been having this discussion as if
has to be either one or the other, and there's no reason we can't have both
(as mentioned before, "reduce()" is live and well in the libraries, for
people who need to use it).
I in particular would not like it at all if something like ":=" was at the
expense of "as", and I think that others on the side of expanding "if" and
"while" may feel the same way.
As a reminder, some of the arguments in favor of "as" are around the
patterns exemplified by the "re" module; patterns which seem correct and
useful, and that are used by other standard and 3rd-party modules.
if os.fork() as child_pid:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas