Comment on Python Performance: Why 'if not list' is 2x Faster Than Using len()
riodoro1@lemmy.world 1 week agoThat’s exactly what I was getting at. Getting length of an empty list would not even enter the loop.
Comment on Python Performance: Why 'if not list' is 2x Faster Than Using len()
riodoro1@lemmy.world 1 week agoThat’s exactly what I was getting at. Getting length of an empty list would not even enter the loop.
ChaoticNeutralCzech@feddit.org 1 week ago
Yes. If it’s empty. But in cases where you need to check, it might as well not be.