PYT - The expressions described in the Python language reference yield only boolean values

Chris Angelico rosuav at gmail.com
Sat Feb 19 20:03:08 EST 2022


On Sun, 20 Feb 2022 at 12:00, vanyp <vanyp at skynet.be> wrote:
>
> *I am trying to learn Python from the grammar given in the Python
> language reference and I am surprised.*
>

The grammar is not the best way to learn the language. It'll show you
a lot of unnecessary details. For technical reasons, Python's grammar
defines expressions in a nested way, but the way most programmers want
to think of it is that there is operator precedence.

https://docs.python.org/3/reference/expressions.html#operator-precedence

The grammar considers that these are different types of expressions,
but they're not really different in actual usage.

ChrisA


More information about the Python-list mailing list