On Fri, Oct 17, 2014 at 11:51 PM, Amit Saha <[email protected]> wrote: > On Sat, Oct 18, 2014 at 12:16 AM, Chris Smith <[email protected]> wrote: >> Yes, that would be a good change to make. >> >> >> On Friday, October 17, 2014 9:10:28 AM UTC-5, Amit Saha wrote: >>> >>> Hi, >>> >>> As per https://github.com/sympy/sympy/issues/6212, is_real is >>> deprecated. I just found this: >>> >>> >>> s = FiniteSet(FiniteSet(1, 2, 3)) >>> >>> s >>> {{1, 2, 3}} >>> >>> len(s) >>> 1 >>> >>> s.powerset() >>> >>> /usr/lib/python3.3/site-packages/sympy-0.7.5_git-py3.3.egg/sympy/functions/elementary/miscellaneous.py:334: >>> SymPyDeprecationWarning: >>> >>> is_real has been deprecated since SymPy 0.7.6. Use is_subset(Reals) >>> instead. See https://github.com/sympy/sympy/issues/6212 for more info. >>> >>> if (arg.is_real is False) or (arg is S.ComplexInfinity): >>> >>> /usr/lib/python3.3/site-packages/sympy-0.7.5_git-py3.3.egg/sympy/core/basic.py:577: >>> SymPyDeprecationWarning: >>> >>> is_real has been deprecated since SymPy 0.7.6. Use is_subset(Reals) >>> instead. See https://github.com/sympy/sympy/issues/6212 for more info. >>> >>> is_real = self.is_real >>> {EmptySet(), {{1, 2, 3}}} >>> >>> In my opinion, the deprecation warnings should be shown only when the >>> library user is invoking the deprecated method/property. >>> >>> Hence, i think usage of is_real from SymPy's code base should be removed. >>> >>> For what it's worth, the first is easy: >>> >>> diff --git a/sympy/functions/elementary/miscellaneous.py >>> b/sympy/functions/elementary/miscellaneous.py >>> index 8adf46d..0935b03 100644 >>> --- a/sympy/functions/elementary/miscellaneous.py >>> +++ b/sympy/functions/elementary/miscellaneous.py >>> @@ -331,7 +331,7 @@ def _new_args_filter(cls, arg_sequence): >>> for arg in arg_sequence: >>> >>> # pre-filter, checking comparability of arguments >>> - if (arg.is_real is False) or (arg is S.ComplexInfinity): >>> + if not arg.is_subset(S.Reals) or arg is S.ComplexInfinity: >>> raise ValueError("The argument '%s' is not comparable." % >>> arg) >>> >>> if arg == cls.zero: >>> > > I have submitted a PR for this one: https://github.com/sympy/sympy/pull/8269 > > I am not sure how to fix this one: > > /usr/lib/python3.3/site-packages/sympy-0.7.5_git-py3.3.egg/sympy/core/basic.py:577: >>> SymPyDeprecationWarning: >>> >>> is_real has been deprecated since SymPy 0.7.6. Use is_subset(Reals) >>> instead. See https://github.com/sympy/sympy/issues/6212 for more info. > > Since is_subset() is not defined for sympy.core.numbers.Infinity (for > example).
I don't understand. Infinity is not a set. Anyway, we shouldn't deprecate something unless the replacement can completely replace it. Aaron Meurer > > Thanks, > Amit. > > -- > 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/CANODV3m%2Byy-1mWw7ZLq_jHSyK%3D7vexG%2BTgaPt9MWxTzoouVfGQ%40mail.gmail.com. > 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%3D6KaUcY10ewNLCd6M7dne3nG_iqDmcRGhKO5b7ps3RTsPQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
