I am -1 to remove it. As I explained in the issue, universal set is analogous to infinity for regular numerical arithmetic. Not all mathematical operations make sense for it, but there are some that do, and they are useful to have. Of course, sometimes you do want to specify your domain. It is similar with numbers: sometimes you want to specify explicitly that you are working with the reals or the rationals or whatever. But it is annoying to have to do this all the time.
We should just fix code that assumes that the reals are the universal set. Aaron Meurer On Sat, May 10, 2014 at 12:35 PM, Sergey B Kirpichev <[email protected]> wrote: > On Sat, May 10, 2014 at 11:03:12AM -0700, Harsh Gupta wrote: >> This comes from the discussions on this PR >> https://github.com/sympy/sympy/pull/7462#issuecomment-42111992 >> We have a class called UniversalSet which is supposed to be *set* which >> contains all the sets which we can define in Sympy. The problem is that we >> really don't "know" what our defined Universal Set is. It has been >> proposed by Sergey that we wipe out the Universal Set class. We can >> explicitly provide the the known defined universal set when situation asks >> for it, that set can be complex, real or real*real or anything. I'm +1 to >> the proposal. I guess this goes with "Explicit is better than Implicit" >> from the Zen of Python. At places we are implicitly assuming UniversalSet >> to Interval(-oo, oo) which is clearly wrong. Then we cannot define >> operations like PowerSet and cardinality on such sets. We can avoid the >> problem by leaving PowerSet or cardinality undefined for UniversalSet, but >> not having an UniversalSet will be a better way to avoid unknown >> inconsistencies. > > btw, some statistics: > $ fgrep -R UniversalSet sympy/|wc -l > 22 > $ fgrep -R UniversalSet sympy/ 2>/dev/null|grep -v 'core/sets.py'|grep -v > 'core/tests/test_sets.py'|wc -l > 8 > > -- > 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. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sympy/20140510183503.GB18695%40debian. > For more options, visit https://groups.google.com/d/optout. -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAKgW%3D6K05cxJ2O3-RRHrT6jtkLcTYOZfnF4UgPPt%2B4XjsuCXiw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
