<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Filip GruszczyƄski wrote:
<blockquote
 cite="mid:1be78d220901031421i60607d9ckab4eebdcccbad83a@mail.gmail.com"
 type="cite">
  <pre wrap="">I am trying to delete a method from a class. It's easy to delete other
attributes, but when I try:

  </pre>
  <blockquote type="cite">
    <blockquote type="cite">
      <blockquote type="cite">
        <pre wrap="">class A:
        </pre>
      </blockquote>
    </blockquote>
  </blockquote>
  <pre wrap=""><!---->...     def foo():
...             pass
...
  </pre>
  <blockquote type="cite">
    <blockquote type="cite">
      <blockquote type="cite">
        <pre wrap="">a = A()
del a.foo
        </pre>
      </blockquote>
    </blockquote>
  </blockquote>
  <pre wrap=""><!---->
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?

  </pre>
</blockquote>
<font size="-1"><font face="sans-serif">Sounds crazy.... <br>
<br>
If you want to delete a function, create lambda functions though am not
sure whether it can be deleted or not.<br>
</font></font><br>
<pre class="moz-signature" cols="72">-- 
Manish Sinha

Personal Blog: <a class="moz-txt-link-freetext" href="http://www.manishsinha.info">http://www.manishsinha.info</a>
Tech Blog: <a class="moz-txt-link-freetext" href="http://manishtech.wordpress.com">http://manishtech.wordpress.com</a>
OpenPGP Key: 99E6658F
</pre>
</body>
</html>