> Since it's for my own purposes I really could represent it with nested > lists/tuples, using booleans to include a value or not: > > [[(-sympy.oo, False), (-1, True)], [(0, False), (sympy.oo, True)]] > > which represents (-inf, -1] U (0, inf) >
For this all you need is sets. Note that they use False/True to mean openness, not inclusion. In [4]: Interval(-oo, -1, True, False) + Interval(0, oo, True, True) Out[4]: (-∞, -1] ∪ (0, ∞) > which would work fine for my purposes. However I'm pretty sure with what I > plan to do I'm going to be using domains a fair bit more in the future so > if I have something that is going to work with what SymPy has planned then > it may help. > I suspect that we're overengineering things. If all you need is to represent sets then SymPy should have you covered. If you also need to attach each set to a particular symbol (like x or y) then we run into new territory. -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sympy. For more options, visit https://groups.google.com/groups/opt_out.
