Comment on Python Performance: Why 'if not list' is 2x Faster Than Using len()
FooBarrington@lemmy.world 1 week agoYes, the first example does the same thing, but there’s still less to mentally parse. Ideally you should just use if len(my list) == 0:
.