Marko Rauhamaa <ma...@pacujo.net>:
> Christian Heimes <christ...@python.org>:
>> Python creates a new bound method object every time. A bound method
>> object is a callable object that keeps a strong reference to the
>> function, class and object. The bound method object adds the object as
>> first argument to the function (aka 'self').
> I stand corrected. I had thought the trampoline ("bound method
> object") was created once and for all.
Sure enough. The principle is explicitly specified in <URL:
>>> class X:
... def f(self):
>>> x = X()
>>> def f(): print("Meh")
>>> x.f = f
>>> delattr(x, "f")
IOW, you can override a method with setattr() but you cannot delete a
method with delattr().