Feb-22-2017, 04:59 AM
(Feb-22-2017, 02:34 AM)ichabod801 Wrote: I don't know why everyone finds bools as ints so surprising. Did no one take discrete math?I took discrete math twice, thank you very much. Still don't understand any of it.
Really though I can see an argument being made either way. I'm used to in the statically typed languages I used booleans not being numeric (Scala / Java). As for the other side...
(Feb-22-2017, 02:28 AM)Skaperen Wrote: i bet it could be argued: it's a featureYes! Python is, by convention, duck typed. It's not just dynamically typed and you're not prohibited by the language from type-checking. If it walks like a duck and quacks like a duck, why do you care if it's really a duck or not? I could design an API that does care, but such designs are not considered Pythonic. Much like "it's better to ask forgiveness than permission" being preferable "look before you leap" - there are situations when either is preferable, the culture of the language is to prefer one, and go to the other only in extraordinary circumstances.