abhi9u@lemmy.world to Technology@lemmy.worldEnglish · 8 months agoPython Performance: Why 'if not list' is 2x Faster Than Using len()blog.codingconfessions.comexternal-linkmessage-square67linkfedilinkarrow-up1110arrow-down118
arrow-up192arrow-down1external-linkPython Performance: Why 'if not list' is 2x Faster Than Using len()blog.codingconfessions.comabhi9u@lemmy.world to Technology@lemmy.worldEnglish · 8 months agomessage-square67linkfedilink
minus-squareJustAnotherKay@lemmy.worldlinkfedilinkEnglisharrow-up1·8 months agoDoesn’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
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 xtells me I need to go manually check what typexis in Python.len(x) == 0tells me that it’s being type-checked automatically