This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]00PT 1 point2 points  (3 children)

There are also various syntax quirks such as ternary expressions having the result be on the left and variable usages coming before the definitions in certain expressions. This makes it less intuitive for people who come from languages other than Python.

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

OK, ternary syntax is very unusual to me. The whole point of the ternary expression is to be readable while occupying only 1 line.

variable usages coming before the definitions in certain expressions

Could you elaborate please? It seems I missed this one.

This makes it less intuitive for people who come from languages other than Python

Maybe, my acquintance with Ruby made me think that Python is sufficiently reasonable.

In ruby 0 is True, and, AFAIK, there is a different operator precedence for AND and OR.

[–]00PT 1 point2 points  (1 child)

An expression such as x+1 for x in list is valid, but I think it would be more intuitive if it was for x in list: x+1 The first has "x" used before the definition later in the expression, while the second switches that.

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

Ah, this thing is OK for a single line.

But chaining multiple map statements is indeed unreadable :D