[Buildbot-devel] assertion error on changes/manager.py

Jorge Gonzalez gjorge at google.com
Thu Aug 8 23:17:13 UTC 2013


I'm not really sure. It sounds right to me but what would the
implementation return?
>From reading the contract in
object.__hash__(*self*)<http://docs.python.org/2/reference/datamodel.html#object.__hash__>
it
seems to me that the problem was that I didn't know my change source would
be used in a hashable collection.
Perhaps, following the advice in that link, it'd be wise to set __hash__ =
None to force the instances to fail at runtime. This will convey the
message more clearly that if you want to extend this class, you *must
*implement
__hash__()

Jorge


On Mon, Jul 1, 2013 at 5:27 PM, Dustin J. Mitchell <dustin at v.igoro.us>wrote:

> On Thu, Jun 27, 2013 at 3:15 AM, Jorge Gonzalez <gjorge at google.com> wrote:
> > I found why. The reason was that my PollingChangeSource wasn't
> implementing
> > __hash__. And the manager.py was putting two instances of my class into a
> > set before adding them to the master. My instances somehow (haven't
> checked
> > why) must have generated the same hash, and only one of them was
> therefore
> > being considered, although my config had a sequence of two of them.
>
> Hm, ComparableMixin should probably implement __hash__.  Would that help?
>
> Dustin
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://buildbot.net/pipermail/devel/attachments/20130808/4073e455/attachment.html>


More information about the devel mailing list