Re: [Python-Dev] "as" keyword woes

2008-12-08 Thread r0g
Virgil Dupras wrote: > On 06 Dec 2008, at 20:38, Warren DeLano wrote: > As long as "as" is widely known as a keyword, I don't see the problem. > Every python developer knows that the convention is to add a trailing > underscore when you want to use a reserved word in your code. Ooo, actually I di

Re: [Python-Dev] "as" keyword woes

2008-12-06 Thread Steven D'Aprano
On Sun, 07 Dec 2008 11:27:56 +1000, Nick Coghlan wrote: > Warren DeLano wrote: >> In other words we have lost the ability to refer to "as" as the >> generalized OOP-compliant/syntax-independent method name for casting: > > Other possible spellings: > > # Use the normal Python idiom for avoiding

Re: [Python-Dev] "as" keyword woes

2008-12-06 Thread Nick Coghlan
Warren DeLano wrote: > In other words we have lost the ability to refer to "as" as the > generalized OOP-compliant/syntax-independent method name for casting: Other possible spellings: # Use the normal Python idiom for avoiding keyword clashes # and append a trailing underscore new_object = old_o

Re: [Python-Dev] "as" keyword woes

2008-12-06 Thread Virgil Dupras
On 06 Dec 2008, at 20:38, Warren DeLano wrote: Date: Fri, 05 Dec 2008 22:22:38 -0800 From: Dennis Lee Bieber <[EMAIL PROTECTED]> Subject: Re: "as" keyword woes To: python-list@python.org Message-ID: <[EMAIL PROTECTED]> I'm still in the dark as to what type of data could even inspire t

Re: [Python-Dev] "as" keyword woes

2008-12-06 Thread Guido van Rossum
On Sat, Dec 6, 2008 at 11:38 AM, Warren DeLano <[EMAIL PROTECTED]> wrote: [...] > There, I assert that 'object.as(class_reference)' is the simplest and > most elegant generalization of this widely-used convention. Indeed, it > is the only obvious concise answer, if you are limited to using methods