I was under the impression it was possible to overload and
in Python, but reading through the docs just now, I realized that __and__
refers to the bitwise &
operator, not logical and
.
Am I overlooking something, or is it not possible to overload logical and
in Python?
No this is not possible. There is a proposal that adds this functionality but for now, it is rejected.
No, it is not possible. See here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With