Filip Gruszczyński wrote:
I am trying to delete a method from a class. It's easy to delete other
attributes, but when I try:
class A:
... def foo():
... pass
...
a = A()
del a.foo
I get
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: A instance has no attribute 'foo'
Why is it so and how may still delete it?
Sounds crazy....
If you want to delete a function, create lambda functions though am not
sure whether it can be deleted or not.
--
Manish Sinha
Personal Blog: http://www.manishsinha.info
Tech Blog: http://manishtech.wordpress.com
OpenPGP Key: 99E6658F
--
http://mail.python.org/mailman/listinfo/python-list