If None and None returns None, (None and None is None) should return True, No?
Was debugging an app and noticed that it returns None
Good question!
(None and None is None)
"is" has a priority, so None is None returns True
"and" executed after that, so None and True result in None
If you add parenthesis, you can make it work in another way:
((None and None) is None) returns True
You can find more info on that topic here: https://docs.python.org/3/reference/expressions.html#operator-precedence
ishappens beforeandfor the same reason that*happens before+. All operators in Python have precedence, not just the usual PEMDAS you learn about in early mathematics.