abhi9u@lemmy.world to Technology@lemmy.worldEnglish · 4 days agoPython Performance: Why 'if not list' is 2x Faster Than Using len()blog.codingconfessions.comexternal-linkmessage-square150fedilinkarrow-up1218arrow-down124
arrow-up1194arrow-down1external-linkPython Performance: Why 'if not list' is 2x Faster Than Using len()blog.codingconfessions.comabhi9u@lemmy.world to Technology@lemmy.worldEnglish · 4 days agomessage-square150fedilink
minus-squareArchr@lemmy.worldlinkfedilinkEnglisharrow-up1·3 days agoI haven’t read the article. But I’d assume this is for the same reason that not not string is faster than bool(string). Which is to say that it has to do with having to look up a global function rather than a known keyword.
I haven’t read the article. But I’d assume this is for the same reason that
not not string
is faster thanbool(string)
. Which is to say that it has to do with having to look up a global function rather than a known keyword.