Two minor syntactic proposals

Bengt Richter bokr at accessone.com
Wed Jun 20 14:44:16 EDT 2001


On 18 Jun 2001 11:57:59 -0700, jeff at ccvcorp.com (Jeff Shannon) wrote:

>philh at comuno.freeserve.co.uk (phil hunt) wrote in message news:<slrn9ipjok.5je.philh at comuno.freeserve.co.uk>...
>> 
>> I propose a different way of doing this: make 'self' implied in all
>> references to instance variables. This involves definiing 2 new keywords,
>> qclass and insvars. So:
I think I prefer just an easier way to type "self."
How about just the dot? I.e., ".x" means "self.x"

[...]
>I much prefer having all member variables and member functions explicitly
>qualified.  Having moved to Python from C++, where members can be referred
>to implicitly, it seems to me that the explicit requirement of Python makes
>code *much* easier to read--no more hunting about to try to figure out whether
>a given variable is a class member, or a parameter, or a global, or from some 
>other scope...  then there's also this problem (using your notation):
[...more reasons...]

So what about a plain  prefixed '.' as an abbreviation for 'self.' ?




More information about the Python-list mailing list