Yes, there is another can of worms in chained comparisons. So far I've implemented parents for LinearFunction, but there should be a parent for LinearConstraint as well. I'm pretty sure your example can be fixed by overriding __nonzero__.
On Wednesday, October 24, 2012 2:23:02 PM UTC+1, P Purkayastha wrote: > > That's only one bug as mentioned in #12091 (having numerics on the left > of a comparison operator). The other bug is the chained inequalities. > > sage: x[0] <= x[1] <= 2 > x_1 <= 2 > > This can't be fixed (I think) without moving to python3. > > On 10/24/2012 05:38 PM, Volker Braun wrote: > > Both bugs are fixed in the ticket's patch. In particular, this now works > > as it should: > > > > sage: x[0] <= 1 > > x_0 <= 1 > > sage: x[0] >= 1 > > 1 <= x_0 > > sage: 1 <= x[0] > > 1 <= x_0 > > sage: 1 >= x[0] > > x_0 <= 1 > > > > > > > > On Wednesday, October 24, 2012 4:31:19 AM UTC+1, P Purkayastha wrote: > > > > This is really nice. A long standing functionality. When we move to > > python3, the other bug can also be taken care of. > > > > -- > > You received this message because you are subscribed to the Google > > Groups "sage-support" group. > > To post to this group, send email to > > [email protected]<javascript:>. > > > To unsubscribe from this group, send email to > > [email protected] <javascript:>. > > Visit this group at http://groups.google.com/group/sage-support?hl=en. > > > > > > > -- You received this message because you are subscribed to the Google Groups "sage-support" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sage-support?hl=en.
