Marko Rauhamaa wrote:

IOW, you can override a method with setattr() but you cannot delete a
method with delattr().

Actually, you can -- but you need to delete it from
the class, not the instance:

>>> delattr(X, 'f')
>>> x.f()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'X' object has no attribute 'f'


Reply via email to