5 ms·
It is certainly the case that isinstance(True, int) returns True, even today.
by LPisGood 22d ago
It is certainly the case that isinstance(True, int) returns True, even today.
- jp_sc 22d agoI got a bug for not remembering it, a couple of years ago: https://jpscaletti.com/p/8/true-false-one-and-zero https://jpscaletti.com/p/8/true-false-one-and-zero
- chlorelladevil 22d agoHmm. Having read your post, surely the bug is having a function where set(foo, false) removes foo entirely. What if you want foo to have the value False? Even besides the unintended behaviour where 0 is coerced to a boolean value, this function seems poorly designed.
- jp_sc 21d agoI don't remember the specifics, it might have been a simplification for the example