"as" keyword woes

Martin P. Hellwig martin.hellwig at dcuktec.org
Thu Dec 4 01:55:59 CET 2008


Steven D'Aprano wrote:
> On Wed, 03 Dec 2008 22:02:24 +0000, Martin P. Hellwig wrote:
> 
>> Warren DeLano wrote:
>>> A bottom line / pragmatic question... hopefully not a FAQ.
>>>
>>> Why was it necessary to make "as" a reserved keyword?
>> <cut>
>> Because it can be used at the import statement to let the imported thing
>> be known under another name?
>> Something like:
>>
>>  >>> import xml.etree.ElementTree as ET
> 
> Martin, that doesn't answer the OP's question *at all*. Python 2.5 uses 
> "as" in that way, and it is not a keyword. 
> 
Yes Steven, I realized after the apple fell on my head that I was 
barking at the wrong tree, in a totally different forest, sorry for the 
  noise.

-- 
mph



More information about the Python-list mailing list