kingthrillgore@lemmy.ml to 196@lemmy.blahaj.zone · 10 months agodoes this code run rulelemmy.mlimagemessage-square44fedilinkarrow-up1293arrow-down10
arrow-up1293arrow-down1imagedoes this code run rulelemmy.mlkingthrillgore@lemmy.ml to 196@lemmy.blahaj.zone · 10 months agomessage-square44fedilink
minus-squareLostXOR@kbin.sociallinkfedilinkarrow-up3·10 months agoresults = [result for result in results if result != None]
minus-squareLostXOR@kbin.sociallinkfedilinkarrow-up3·10 months agoYou’re right, though IIRC there’s no functional difference when comparing to None (other than speed).
minus-squareAVincentInSpace@pawb.sociallinkfedilinkEnglisharrow-up9·10 months agoYes there is. One invokes __ne__ on the left hand side, the other performs an identity comparison.
results = [result for result in results if result != None]
Should be
is not None
(:You’re right, though IIRC there’s no functional difference when comparing to None (other than speed).
Yes there is. One invokes
__ne__
on the left hand side, the other performs an identity comparison.