4 ms·
> bool() is a truthiness check and not a type cast like int() and float(). It seems like your issue is with the name of the function, because if it was more apt
by akoboldfrying 1y ago
> bool() is a truthiness check and not a type cast like int() and float(). It seems like your issue is with the name of the function, because if it was more aptly named to something like istruthy() this discussion wouldn't be happening.
Right, the bug is in the inconsistent naming.
It's roughly as bad as having arithmetic operators named +, -, *, / that perform arithmetic as usually understood, except that + actually performs XOR and is documented to do so.
- tmh88j 1y ago> Right, the bug is in the inconsistent naming. The comment I responded to didn't seem to realize that because they asked why it behaves the way it does, so I explained.