Re: Class methods read-only by default?

2009-04-03 Thread Piet van Oostrum
> "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: '

Re: Class methods read-only by default?

2009-04-03 Thread Emanuele D'Arrigo
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

Re: Class methods read-only by default?

2009-04-02 Thread Steven D'Aprano
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:

Re: Class methods read-only by default?

2009-04-02 Thread andrew cooke
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

Class methods read-only by default?

2009-04-02 Thread Emanuele D'Arrigo
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