Russell E. Owen wrote: > The "hash" function looks promising -- it prints out consistent values > if I use it instead of "id" in the code above. Is it stable and unique? > The documentation talks about "objects" again, which given the behavior > of id makes me pretty nervous. > I dont know how the hash of a bound method is calculated,but as the function of the method is a stable and referenced object and as instances lives are in your hands,then an id(self)^id(self.meth.im_func) should be a chance for that 'hash' function.
def methodId(boundMethod): return id(boundMethod.im_self)^id(boundMethod.im_func) class cls(object): def __init__(self): print methodId(self.meth1) print methodId(self.meth2) def meth1(self): pass def meth2(self): pass c = cls() print methodId(c.meth1) print methodId(c.meth2) I think this is giving what you expected. Regards Paolino ___________________________________ Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB http://mail.yahoo.it -- http://mail.python.org/mailman/listinfo/python-list