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-03 Thread Piet van Oostrum
Emanuele D'Arrigo man...@gmail.com (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 stdin, line 1, in module ED AttributeError: 'C' object

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 stdin, line 1, in module AttributeError: 'C' object attribute 'method' is read-only How come?

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 stdin, line 1, in module AttributeError: 'C' object