4 ms·
I would argue that the vast majority of behaviours described here are precisely the desired behaviour. In fact, I think the ones he picks reflect tremendously
by ris 11y ago
I would argue that the vast majority of behaviours described here are precisely the desired behaviour.
In fact, I think the ones he picks reflect tremendously on his skill as a programmer.
Take for instance his apparent insistence that int(2 * '3') should produce 6. Cool. Magic "special" behaviour for the multiply operator if the string happens to contain a number.
The same goes for his desire for the string "False" to be falsey. Wonderful magic special behaviour dependent on the (possibly unknown) content of a string means I've got to go round checking my strings for magic values.
- d23 11y agoI agree, but there's enough weird shit going on here that it's still a worthwhile "article". For me, the `mixing numerical types`, `Operator precedence?`, `extend vs +=`, `Indexing with floats`, `all and emptiness`, and `Comparing NaNs` were all interesting.