The behavior desired is this:
In [653]: choice = 'A'
In [654]: not(choice)
Out[654]: 'B'
Is there a robust way in which this can be done? Currently I'm using simple hacks like these.
def other(choice):
if choice == 'A':
return 'B'
else:
return 'A'
In [635]: other('B')
Out[635]: 'A'
d = dict()
d['A'] = 'B'
d['B'] = 'A'
In [652]: d['A']
Out[652]: 'B'