>>> repr(None) is repr(None)
False
>>> repr(True) is repr(True)
True
The bool
type constant caches the string object internally and reuses it, but None
creates the string object every time.
Probably no rational intention, just forgetting to do the efficiency improvement that bool
is doing in None
.