storm.expr.Comparable should support unary '-'

Bug #397654 reported by Michael Hudson-Doyle on 2009-07-10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Michael Hudson-Doyle

Bug Description

Storm appears to lack support for unary -:

>>> author = Func('coalesce', RevisionAuthor.personID,
Traceback (most recent call last):
  File "<console>", line 1, in ?
TypeError: bad operand type for unary -

You can work around this like so:

>>> author = Func('coalesce', RevisionAuthor.personID, SQL(0)

But that's pretty heinous.

It doesn't look like this would be very hard to fix.

Related branches

Jamu Kakar (jkakar) wrote :

Merged to storm/trunk r313:

Michael Hudson 2009-07-22 [merge]
Merged unary-minus [r=jamesh,niemeyer] [f=397654]

A new Neg expression provides support for unary minus. A minus is
automatically prepended to the expression passed to Neg. A couple
of failures in the Zope doctest related to differences in repr
formatting between python2.5 and python2.6 have also been fixed.

Changed in storm:
importance: Undecided → Medium
assignee: nobody → Michael Hudson (mwhudson)
status: New → Fix Committed
milestone: none → 0.15
Jamu Kakar (jkakar) on 2009-08-08
Changed in storm:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers