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

<- View Parent
mint_tamas@lemmy.world ⁨5⁩ ⁨days⁩ ago

I think pythonic is more important than performance and I would still choose that version over a try-catch block, were it slower. Being pythonic means it represents a commonly understood pattern in Python code, therefore it is more efficient in communicating intent.

source
Sort:hotnewtop