Access to S constants directly eval(srepr(S.UniversalSet))

22 views
Skip to first unread message

latot

unread,
Sep 24, 2016, 11:29:59 PM9/24/16
to sympy, felip...@yahoo.com
Hi all, well as you know S have constants like Reals, UniversalSet, EmptySet, etc... I need some way to can use it directly (eval some str and get it), this is because srepr don't return the full expression:

from sympy import *
S.Reals
(-oo, oo)
srepr(S.Reals)
'Reals(-oo, oo, S.true, S.true)'
eval(srepr(S.Reals))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<string>", line 1, in <module>
NameError: name 'Reals' is not defined

Are some function to return the full expression? like 'S.Reals(-oo, oo, S.true, S.true)'
I'm not an expert in python, so this maybe can be fixed with an import, but i don't know which...

Thx. Cya.

Aaron Meurer

unread,
Sep 24, 2016, 11:32:00 PM9/24/16
to sy...@googlegroups.com, felip...@yahoo.com
This is a bug. Reals(-oo, oo, S.true, S.true) isn't actually correct. srepr(S.Reals) should be returning "S.Reals). See https://github.com/sympy/sympy/issues/10035.

Aaron Meurer

--
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 sympy+unsubscribe@googlegroups.com.
To post to this group, send email to sy...@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/d854a5e0-be21-4248-b354-dc1b1df0125e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

latot

unread,
Sep 24, 2016, 11:42:53 PM9/24/16
to sympy, felip...@yahoo.com
Hi, thx for the info, searching in the modules of Sympy i found how access to that parts:

from sympy.sets.fancysets import *

Thx.

Aaron Meurer

unread,
Sep 25, 2016, 2:21:02 AM9/25/16
to sy...@googlegroups.com, felip...@yahoo.com
You may be interested in this issue as well https://github.com/sympy/sympy/issues/11378

Aaron Meurer 
--
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 sympy+unsubscribe@googlegroups.com.
To post to this group, send email to sy...@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.

latot

unread,
Sep 28, 2016, 12:59:01 PM9/28/16
to sympy, felip...@yahoo.com
Hi all, well i have more problems with this, what i need import to have access to all domains defined in sets?

i post here this helps:
from sympy.sets.fancysets import *

but sadly don't works with UniversalSet, i try import the sets module but didn't works too.

Aaron Meurer, thx for the issue info.


El domingo, 25 de septiembre de 2016, 0:29:59 (UTC-3), latot escribió:

latot

unread,
Sep 28, 2016, 5:06:04 PM9/28/16
to sympy, felip...@yahoo.com
Hi all, well experimenting to can access to all sets we need import two things:

    from sympy.sets.fancysets import *
    from sympy.sets.sets import *

Thx. Cya.

El domingo, 25 de septiembre de 2016, 0:29:59 (UTC-3), latot escribió:
Reply all
Reply to author
Forward
0 new messages