Peter Drake HAS MOVED on Nostr: I'm still confused by this #python oddity, originally posted by Mike Driscoll: x = ...
I'm still confused by this #python oddity, originally posted by Mike Driscoll (npub1ht8…374v):
x = True
y = False
print(x is (not y))
print(not x is y)
print(not (x is y))
print((not x) is y)
print(x is not y)
print(x == (not y))
print(not x == y)
print(not (x == y))
print((not x) == y)
print(x == not y)
Why is the last line a syntax error when the rest are fine?
x = True
y = False
print(x is (not y))
print(not x is y)
print(not (x is y))
print((not x) is y)
print(x is not y)
print(x == (not y))
print(not x == y)
print(not (x == y))
print((not x) == y)
print(x == not y)
Why is the last line a syntax error when the rest are fine?