Jason Novinger@programming.devM to Python@programming.dev · 2 days agoPython Performance: Why 'if not list' is 2x Faster Than Using len()blog.codingconfessions.comexternal-linkmessage-square48linkfedilinkarrow-up161arrow-down14cross-posted to: technology@lemmy.world
arrow-up157arrow-down1external-linkPython Performance: Why 'if not list' is 2x Faster Than Using len()blog.codingconfessions.comJason Novinger@programming.devM to Python@programming.dev · 2 days agomessage-square48linkfedilinkcross-posted to: technology@lemmy.world
minus-squareMichal@programming.devlinkfedilinkarrow-up6·1 day agoIt’s just how pythonic code is written. All python developers know that not and bool can indicate that variable is either empty or null. They will also use the in operator and other python specific syntax.
It’s just how pythonic code is written. All python developers know that
not
andbool
can indicate that variable is either empty or null. They will also use thein
operator and other python specific syntax.