Trivia: String representation of constant values

>>> 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.

Recommended Posts

Trivia: String representation of constant values
Convert vector of integer values to one hot representation
Summary of string operations
Sober trivia of python3
Python --Check type of values