sqlobject is_empty and __nonzero__ are incorrect
Bug #659078 reported by
Brad Crittenden
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
High
|
Gary Poster | ||
Storm |
Fix Released
|
High
|
Jeroen T. Vermeulen |
Bug Description
The implementation for is_empty is currently:
def is_empty(self):
"""Return C{True} if this result set doesn't contain any results."""
result_set = self._without_
return not result_
The 'not' shouldn't be there.
Also note that __nonzero__ is currently wrong but produces correct results. It will break when is_empty is fixed.
So, simply recycle the 'not' from is_empty and donate it to __nonzero__.
Related branches
lp:~jtv/storm/bug-659078
- Björn Tillenius (community): Approve
- Jamu Kakar (community): Approve
- Storm Developers: Pending (code) requested
-
Diff: 65 lines (+7/-8)2 files modifiedstorm/sqlobject.py (+3/-3)
tests/sqlobject.py (+4/-5)
lp:~gary/launchpad/storm-0.18
- Aaron Bentley (community): Approve
-
Diff: 15 lines (+1/-4)1 file modifiedversions.cfg (+1/-4)
Changed in storm: | |
importance: | Undecided → High |
status: | New → In Progress |
milestone: | none → 0.18 |
Changed in storm: | |
status: | In Progress → Fix Committed |
Changed in storm: | |
assignee: | nobody → Jeroen T. Vermeulen (jtv) |
status: | Fix Committed → In Progress |
Changed in storm: | |
status: | In Progress → Fix Committed |
affects: | rosetta → launchpad |
affects: | launchpad → launchpad-foundations |
Changed in launchpad-foundations: | |
assignee: | nobody → Gary Poster (gary) |
Changed in storm: | |
status: | Fix Committed → Fix Released |
tags: |
added: qa-untestable removed: qa-needstesting |
Changed in launchpad-foundations: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
I've asked Jamu for an estimate on when 0.18 might be out. I expect not soon, in which case we'll either merge this back into our 0.17 branch or move to Storm's trunk (Robert mentioned a bug on trunk to avoid earlier, so I'd need to get the details on that before proceeding).