Windson Yang <wiwind...@outlook.com> 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 returned; > otherwise, y is evaluated and the resulting value is returned. Sorry, Steven. I should make it clear. I think the output of the example(1, 3) depends on the input order of number(1 or 0, 0 or 1) is not an expected behavior to me. Maybe we can add an example/note in the document. "Sometimes this will cause unexpected behavior when you put `or` and `and` together..." ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue36248> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com