On 2007-12-06, samwyse <[EMAIL PROTECTED]> wrote: > And that's my complaint. The value in <zed> is being replaced > by something almost, but not quite, identical to the original > value. Python's internal implementation of __iadd__ for <int> > isn't returning <self>, it's returning a new value belonging to > the super-class.
int.__iadd__ cannot return self because int instances are immutable. In order to return self it would first have to change what's unchangeable. > My whole point is overloading <int> was that > I'd hoped to avoid having to write a bunch of methods to > perform in-place modifications. Looks like I stuck, however. You have to implement only the operations you actually use. So to save yourself drudge-work, use fewer operations. ;-) -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list