Frank Niessink wrote:

 > However, the instance the two methods belong to are different, i.e.
 > id(callback) returns different values for the two methods.

are you using the *object* as the callback?  otherwise, that sentence 
doesn't make much sense; bound methods are generated on the fly, and the 
identity may or may not be reused, depending on how things are garbage 
collected:

 >>> f.bar
<bound method foo.bar of <__main__.foo object at 0x009D1BD0>>
 >>> id(f.bar)
10322248
 >>> id(f.bar)
10322328
 >>> id(f.bar)
10322328
 >>> id(f.bar)
10322328
 >>> id(f.bar), id(f.bar)
(10322328, 10322328)
 >>> map(id, (f.bar, f.bar, f.bar))
[10322328, 10322248, 10322368]

</F>

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to