Explicit Frustration of the Self

Gonçalo Rodrigues op73418 at mail.telepac.pt
Tue Dec 31 17:16:07 EST 2002


On 31 Dec 2002 20:47:25 GMT, bokr at oz.net (Bengt Richter) wrote:

>On Tue, 31 Dec 2002 16:19:32 GMT, Andrew Koenig <ark at research.att.com> wrote:
>
>>> What of elegance?
>>
>>> class Life:
>>> 	property = "value"
>>> def Meaning(self, argument):
>>> 		return self.property
>>
>>> This whole business with the self; it is not elegant.  And, it is of
>>> my opinion that it is, therefore, not good programming.  So I'm
>>> angry, because most of Python is so easy, so elegant, and this
>>> ain't.
>>
>>How would you like to be able to write it instead?  Show us some
>>examples.  Whatever you come up with, I'll bet it will be possible
>>to find even greater problems.
>>
>Someone proposed just a bare leading dot or invisible self name.
>
>  class Foo:
>      bar = 123 
>      def baz(,arg):
>          .arg = arg
>          return .bar+arg
>
>It's less typing anyway. That's a plus for me.

I remember having proposed that a long time ago. The answer that I got
at the time was that the . is barely visible - besides backwards
compatibility of course.

>
>Regards,
>Bengt Richter

With my best regards,
G. Rodrigues



More information about the Python-list mailing list