isn&#x27;t it doing the opposite? str(False) is the string &quot;False&quot;, which bool() casts to True because it is a non-empty string;  Non-empty strings are cast to True booleans.<p>This is much faster than checking if the string has some semantic meaning first, which would have to be localized.