Comment on Python Performance: Why 'if not list' is 2x Faster Than Using len()
knighthawk0811@lemmy.ml 1 week ago
so these are the only 2 ways then? huge if true
Comment on Python Performance: Why 'if not list' is 2x Faster Than Using len()
knighthawk0811@lemmy.ml 1 week ago
so these are the only 2 ways then? huge if true
sugar_in_your_tea@sh.itjust.works 1 week ago
Oh, there are plenty of other terrible ways:
if not any(True for _ in mylist):
I could probably come up with a few others as well.