launchpadlib should implement __eq__ and __ne__
Bug #264098 reported by
Francis J. Lacoste
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
launchpadlib |
Fix Released
|
High
|
Leonard Richardson |
Bug Description
Currently:
>>> launchpad.
False
I think that should be True. We could probably implement __eq__ to look at the resource type URL and the object Etag and return True when they are equals.
For collection, we could probably return True whenever the identify URL is equals.
Related branches
Changed in launchpadlib: | |
importance: | Undecided → Medium |
status: | New → Triaged |
Changed in launchpadlib: | |
status: | Triaged → Fix Committed |
Changed in launchpadlib: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
I think this is fixed in the attached branch: ------- ------- ------- ------- ------- ------- ------- ---- resource. py: changed order of checks in HostedFile. __eq__( ), ------- ------- ------- ------- ------- ------- ------- ---- resource. py: Implemented __eq__ and __ne__ for Ressources,
'last_modified' attributes are equal
-------
revno: 33
committer: Markus Korn <email address hidden>
branch nick: fix.264098.eq.ne
timestamp: Fri 2009-01-16 20:41:57 +0100
message:
* launchpadlib/
this avoids calling open() for this resource of this does not look like a
file and does not have the same url.
-------
revno: 32
committer: Markus Korn <email address hidden>
branch nick: fix.264098.eq.ne
timestamp: Fri 2009-01-16 20:29:20 +0100
message:
* launchpadlib/
Collections and HostedFiles, with following rules:
- two ressources are equal if the values of their 'self_link' and
'http_etag' attributes are equal
- two collections are equal if the value of their 'self_link' attributes
are equal
- two hosted files are equal if the values of their 'url' and
- __ne__ always returns always the revers of __eq__
- __eq__ always returns False if any error occurs