Comment #2 on issue 3166 by [email protected]: Interval and FiniteSet printing
http://code.google.com/p/sympy/issues/detail?id=3166
Another idea, for the classes which can take Intervals as arguments, it is
possible to use the short construction string.
In [3]: x = Symbol('x', real=True)
In [4]: Intersection(Interval(1, 3), Interval(x, 6))
Out[4]: [1, 3] ∩ [x, 6]
In [5]: str(Intersection(Interval(1, 3), Interval(x, 6)))
Out[5]: Intersection([1, 3], [x, 6])
The Out[5] can be valid not only as:
Out[5]: Intersection(Interval(1, 3), Interval(x, 6))
but and as
Out[5]: Intersection((1, 3), (x, 6))
if Intersection constructor can accept tuple and understand that it is
Interval and parse correctly.
This case is only of the ends are not open. (Or for open? As it will be
confused and strange that (1, 3) --> [1, 3] for `pprint`)
Unfortunately it is not possiblely to use `Intersection([1, 3], [x, 6])`,
because
arguments must be immutable.
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy-issues?hl=en.