I know I can use assignment operators with arithmetic operators in Python, for example:
x = 0x8
x |= 0x1 # x equals 9
I'd like to know if this is also possible with logical operators, for example something like:
x = 2 > 3 # False
y = 4 > 3 # True
x or= y # x equals True
Is there something similar to that =or operation that I can use?
[] or {0+1j}x |= yis functionally identical to your proposedx =or ystatement.andandoroperators are defined for many types, so should the answer be