#19040: defuse bool(x!=0) performance bomb
-------------------------------+------------------------
       Reporter:  rws          |        Owner:
           Type:  enhancement  |       Status:  new
       Priority:  major        |    Milestone:  sage-6.9
      Component:  symbolics    |   Resolution:
       Keywords:               |    Merged in:
        Authors:               |    Reviewers:
Report Upstream:  N/A          |  Work issues:
         Branch:               |       Commit:
   Dependencies:               |     Stopgaps:
-------------------------------+------------------------

Comment (by rws):

 Replying to [comment:1 vdelecroix]:
 > `    if not x:`
 `bool(not x)` calls `PyObject_IsTrue` which calls `Expression.__nonzero__`
 which atm tries to prove that `x` is nonzero
 > or with `not x` replaced by `x.is_zero()`.
 This calls `PyObject_IsTrue` as well.
 > So this change would also implies to change all of these in a uniform
 way.
 Right, `Expression.__nonzero__` will then call `x.is_trivial_zero()` and
 everyone who wants a proof needs a dfferent method.

--
Ticket URL: <http://trac.sagemath.org/ticket/19040#comment:2>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" 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/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to