"as" keyword woes

Bruno Desthuilliers bruno.42.desthuilliers at websiteburo.invalid
Wed Dec 10 10:51:42 EST 2008


Lie a écrit :
> On Dec 7, 2:38 am, "Warren DeLano" <war... at delsci.com> wrote:
(snip)
>> As someone somewhat knowledgable of how parsers work, I do not
>> understand why a method/attribute name "object_name.as(...)" must
>> necessarily conflict with a standalone keyword " as ".  It seems to me
>> that it should be possible to unambiguously separate the two without
>> ambiguity or undue complication of the parser.
>>
(snip)
 >
> And let things like:
> 
> filelike.print('lpt') # python 2.6
> zipper.with('7z')
> failure.try(alternative)
> executecodeobject.if(True)
> onfailure.break()
> 
> ?

As far as I'm concerned, I'd find this perfectly acceptable - there's no 
possible confusion here. Now this wouldn't be very practical, since 
you'd have to define the functions outside the class (with a valid 
identifier) then bind them to the class.

But this is probably not going to happen anyway...



More information about the Python-list mailing list