Assume I got two pyomo sets A & B, which are containing following elements:
m.A = {1,2,3,4,5}
m.B = {a,b,c,d,5}
I want to check; if A has some elements which are also in B:
EDIT:
Well following does not work:
if m.A & m.B is not None:
raise ValueError
At least for my case when m.A = [None]
and m.B = ['some_string']
, if-statement is also triggered, but bool(m.A & m.B)
is working.