minus-squareArchr@lemmy.worldtoTechnology@lemmy.world•Python Performance: Why 'if not list' is 2x Faster Than Using len()linkfedilinkEnglisharrow-up1·4 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. linkfedilink
minus-squareArchr@lemmy.worldtoProgrammer Humor@programming.dev•Does this exist anywhere outside of C++?linkfedilinkarrow-up7·edit-211 days agoprint('string\n', end='') linkfedilink
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.