> "Emanuele D'Arrigo" (ED) wrote:
>ED> Hi Everybody!
>ED> I just tried this:
> class C(object):
>ED> ...def method(self):
>ED> ...pass
>ED> ...
> c = C()
> delattr(c, "method")
>ED> Traceback (most recent call last):
>ED> File "", line 1, in
>ED> AttributeError: '
Thank you both, Steven and Andrew, for the insightful explanation. I
shall keep it in mind when thinking about classes methods and
instances. Thank you again.
Manu
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, 02 Apr 2009 06:07:20 -0700, Emanuele D'Arrigo wrote:
> Hi Everybody!
>
> I just tried this:
>
class C(object):
> ...def method(self):
> ...pass
> ...
c = C()
delattr(c, "method")
>
> Traceback (most recent call last):
> File "", line 1, in
> AttributeError:
Emanuele D'Arrigo wrote:
> Hi Everybody!
>
> I just tried this:
>
class C(object):
> ...def method(self):
> ...pass
> ...
c = C()
delattr(c, "method")
>
> Traceback (most recent call last):
> File "", line 1, in
> AttributeError: 'C' object attribute 'method' is read-o
Hi Everybody!
I just tried this:
>>> class C(object):
...def method(self):
...pass
...
>>> c = C()
>>> delattr(c, "method")
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'C' object attribute 'method' is read-only
How come? Who told the class to make the m