minus-squareBlackRoseAmongThorns@slrpnk.nettoTechnology@lemmy.world•Python Performance: Why 'if not list' is 2x Faster Than Using len()linkfedilinkEnglisharrow-up2·4 days agoNot really, generators have weird truthiness, i don’t remember if they evaluate to true or false, but they cannot be checked for emptiness so they default to either always true or always false. linkfedilink
minus-squareBlackRoseAmongThorns@slrpnk.nettoAsk Lemmy@lemmy.world•What were you surprised to learn wasn't actually normal?linkfedilinkarrow-up3·4 days agoWhat in the fuck 🤮 linkfedilink
minus-squareBlackRoseAmongThorns@slrpnk.nettoAsk Lemmy@lemmy.world•*Permanently Deleted*linkfedilinkarrow-up1·26 days agoAccidental good username linkfedilink
Not really, generators have weird truthiness, i don’t remember if they evaluate to true or false, but they cannot be checked for emptiness so they default to either always true or always false.