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

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

Apart from the quote from the zen of python, does this really make your code better though? You will end up writing 4-5 lines with an extra level of indentation. The code does the same, but has worse performance and communicates the intent poorly (compared to the “pythonic” version).

source
Sort:hotnewtop