Proposed new syntax

Ben Finney ben+python at benfinney.id.au
Mon Aug 14 05:59:47 EDT 2017


Steven D'Aprano <steve+comp.lang.python at pearwood.info> writes:

> On Sun, 13 Aug 2017 21:06:08 -0700, Rustom Mody wrote:
>
> > Here's a bunch of different ways in which a mapping comprehension
> > could be implemented:
>
> Not in Python they couldn't be

You began by asking what people would expect syntax to mean.

Then you expressed surprise that anyone would think a comprehension
would be interpreted by the reader as a single operation.

The designer of that feature expressed that yes, the intention was that
it be interpreted as a single conceptual operation, not a looping
sequence of operations.

Your latest counter has been that Python means something special, beyond
what the feature's designer intended, and it's implemented as a looping
sequence of operations.

So it's normal to point out that Python's implementation is just one way
that it could be implemented, hence the reader can reasonably expect
that it's not the way Python implemented it.

You were apparently, at the start of this thread, honestly seeking to
know how people interpret the syntax.

At what point will you accept the feedback: That the comprehension
syntax *does not* necessarily connote a procedural loop, but instead can
quite reasonably be interpreted as its designer intended, a single
conceptual operation.

-- 
 \                “The priesthood have, in all ancient nations, nearly |
  `\     monopolized learning.” —John Adams, _Letters to John Taylor_, |
_o__)                                                             1814 |
Ben Finney




More information about the Python-list mailing list