Comment on Python Performance: Why 'if not list' is 2x Faster Than Using len()

<- View Parent
thebestaquaman@lemmy.world ⁨3⁩ ⁨weeks⁩ ago

I would say it depends heavily on the language. In Python, it’s very common that different objects have some kind of Boolean interpretation, so assuming that an object is a bool because it is used in a Boolean context is a bit silly.

source
Sort:hotnewtop