Two minor syntactic proposals
phil hunt
philh at comuno.freeserve.co.uk
Wed Jun 20 17:59:19 EDT 2001
On Wed, 20 Jun 2001 18:44:16 GMT, Bengt Richter <bokr at accessone.com> wrote:
>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"
That sounds a good idea.
>>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.' ?
i wish i'd thought of it
--
## Philip Hunt ##
## philh at comuno.freeserve.co.uk ##
More information about the Python-list
mailing list