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

<- View Parent
JustAnotherKay@lemmy.world ⁨2⁩ ⁨days⁩ ago

Doesn’t matter what it implies. The entire purpose of programming is to make it so a human doesn’t have to go do something manually.

not x tells me I need to go manually check what type x is in Python.

len(x) == 0 tells me that it’s being type-checked automatically

source
Sort:hotnewtop