[issue36248] document about `or`, `and` operator.

2019-03-09 Thread SilentGhost
Change by SilentGhost : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bu

[issue36248] document about `or`, `and` operator.

2019-03-09 Thread Windson Yang
Windson Yang added the comment: SilentGhost, I think you give a great example to explain this behavior. If the behavior is obvious to you, we can close this issue. -- ___ Python tracker

[issue36248] document about `or`, `and` operator.

2019-03-09 Thread SilentGhost
SilentGhost added the comment: Windson, it still is not clear what exactly you find unexpected in view of supplied links: 1 or 0 and 3 or has higher precedence than and, therefore it's evaluated first. It's first argument (1) is truthy, therefore it's returned. End of comparison. 0 or 1 and

[issue36248] document about `or`, `and` operator.

2019-03-09 Thread Windson Yang
Windson Yang added the comment: Thank you Serhiy, we did document here: > The expression x and y first evaluates x; if x is false, its value is > returned; otherwise, y is evaluated and the resulting value is returned. > The expression x or y first evaluates x; if x is true, its value is re

[issue36248] document about `or`, `and` operator.

2019-03-08 Thread Steven D'Aprano
Steven D'Aprano added the comment: Document *what* about the behaviour shown? I'm sure you don't mean to say that we should document the fact the *literally* `1 or 0 and 3` returns 1, but I don't know what you think we should document beyond what is already stated in the existing docs. It m

[issue36248] document about `or`, `and` operator.

2019-03-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is already documented. Just follow the link from "or" or "and". https://docs.python.org/3/reference/expressions.html -- nosy: +serhiy.storchaka ___ Python tracker

[issue36248] document about `or`, `and` operator.

2019-03-08 Thread Windson Yang
New submission from Windson Yang : I think we should document the behavior as below, (maybe at https://docs.python.org/3/reference/expressions.html#operator-precedence) >>> 1 or 0 and 3 1 >>> 0 or 1 and 3 3 Please correct me if we already document it. -- assignee: docs@python compone