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?
anddo? Or are you just asking for purely theoretical reasons?Add, I replace it with a call to__add__, but I was surprised that I couldn't find a function to replace anAndnode in AST with.__bool__.