CompassRed
@CompassRed@discuss.tchncs.de
This is a remote user, information on this page may be incomplete. View at Source ↗
- Comment on Python Performance: Why 'if not list' is 2x Faster Than Using len() 2 days ago:
It’s not the same, and you kinda answered your own question with that quote. Consider what happens when an object defines both dunder bool and dunder len. It’s possible for dunder len to return 0 while dunder bool returns True, in which case the falsy-ness of the instance would not depend at all on the value of len