#13646: Bug in p.add_constraint (when input is True/False)
-----------------------------------------------+----------------------------
Reporter: ncohen | Owner: ncohen
Type: defect | Status: needs_review
Priority: major | Milestone: sage-5.5
Component: linear programming | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Nathann Cohen, Volker Braun | Merged in:
Dependencies: | Stopgaps:
-----------------------------------------------+----------------------------
Comment (by ncohen):
> I found a lot of places in the graphs stuff where `Sum(...) + Sum(...)`
occurs. As soon as one of the sums returns ``None`` this will raise a
`TypeError`.
And if it never did, it may be because there is mathematical reason for
that, or did you make sure of the opposite ?
> And the problem is precisely that it can't return
`MixedIntegerLinearProgram.base_ring()` because that requires an instance
of `MixedIntegerLinearProgram`.
How come you ignored my question about returning int(0) ?
> Right now the Sum is just deprecated, so you have at least a year to
replace `Sum()` -> `p.sum()`. Which is a pretty simple search&replace. No
code will break with this patch, you only get a deprecation warning the
first time that you use `Sum`.
Nice.
> We will remove the hardcoded RDF in #13650, so its just a matter of time
until its gone. Its not an option to hardcode RDF in Sum in the long run.
It has been an option to not have a base ring at all for a very long while
now.
Nathann
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13646#comment:21>
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 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/sage-trac?hl=en.