3 ms·
> Python allows the overriding of just about every operator. Except the boolean operators (and, or, not). For instance __and__ overrides the binary and (&), no
by glandium 9y ago
> Python allows the overriding of just about every operator.
Except the boolean operators (and, or, not). For instance __and__ overrides the binary and (&), not the boolean and.
- Cyphase 9y agoThat's True, but you _can_ override __bool__.[1] [1] https://docs.python.org/3/reference/datamodel.html#object.__bool__ https://docs.python.org/3/reference/datamodel.html#object.__...