Python Performance: Why 'if not list' is 2x Faster Than Using len()
https://lemmy.world/post/28121911
Lemmy
if isinstance(mylist, list) and not mylist
Problem solved.
Or if not mylist # check if list is empty
if not mylist # check if list is empty