newbie: self.member syntax seems /really/ annoying

Colin J. Williams cjw at sympatico.ca
Tue Sep 18 07:44:36 EDT 2007


BJörn Lindqvist wrote:
> On 9/12/07, Dave Hansen <iddw at hotmail.com> wrote:
>> The name "self" is just a convention.  You can give it any name you
>> wish.  Using "s" is common.
> 
> Not it's not common. And the name "self" is a convention codified in
> PEP8 which you shouldn't violate.
> 
> And I agree with the OP that the convention is really annoying.
> 
>   self.rect.width = self.foo(self.rect.x + self.rect.y) * self.boo()
> 
> is much less concise than
> 
>   s.rect.width = s.foo(s.rect.x + s.rect.y) * s.boo()
> 
Yes, but the OP went a step further, he suggested:

.rect.width = .foo(.rect.x + .rect.y) * .boo()

Among the many responses, I didn't spot anyone who dealt with this issue.

Does this preceding "." create parsing problems?

Colin W.




More information about the Python-list mailing list