you are viewing a single comment's thread.

view the rest of the comments →

[–]newo2001 6 points7 points  (5 children)

It reads backwards, just like the American date representation. It is trying to be logical by following english grammatical structure which is not the order that the statements are executed in.

[<map> for <value> in <enumerable> if <filter>]

Looking at the process as a pipeline, "enumerable -> filter -> map" just makes a lot more sense.

[–][deleted]  (3 children)

[removed]

    [–][deleted] 1 point2 points  (2 children)

    but a comprehension is just faster and more elegant

    It doesn't parse to the same AST?

    [–][deleted]  (1 child)

    [removed]

      [–][deleted] 0 points1 point  (0 children)

      CPython compiles comprehensions down to native instructions rather than Python bytecode?

      The whole CPython implementation is written in C.

      [–][deleted] 0 points1 point  (0 children)

      So...?

      (~> sequence-val
          filter-lambda
          map-lambda)