Comment on Python Performance: Why 'if not list' is 2x Faster Than Using len()

<- View Parent
JasonDJ@lemmy.zip ⁨4⁩ ⁨days⁩ ago

if isinstance(mylist, list) and not mylist

Problem solved.

Or if not mylist # check if list is empty

source
Sort:hotnewtop