"as" keyword woes

MRAB google at mrabarnett.plus.com
Sat Dec 6 18:54:55 CET 2008


Mensanator wrote:
> On Dec 6, 8:16�am, Wolfgang Strobl <ne... at mystrobl.de> wrote:
>> Dennis Lee Bieber <wlfr... at ix.netcom.com>:
>>
>>> On 05 Dec 2008 05:21:25 GMT, Steven D'Aprano
>>> <st... at REMOVE-THIS-cybersource.com.au> declaimed the following in
>>> comp.lang.python:
>>>> On Thu, 04 Dec 2008 08:44:19 -0800, Matimus wrote:
>>>>> The point was that there
>>>>> is that new releases don't _break_ anything.
>>>> But that's clearly not true, because the OP is pointing out that the new
>>>> release from 2.5 to 2.6 *does* break his code.
>>> � �One now has to ask what "break" really meant... For this example,
>>> the change did not break Python SYNTAX -- just a complaint about using
>>> what is now a reserved word as an object name.
>> Of course it does:
>>
>> C:\Python26>python
>> Python 2.6 (r26:66721, Oct �2 2008, 11:35:03) [MSC v.1500 32 bit
>> (Intel)] on win 32
>> Type "help", "copyright", "credits" or "license" for more information.>>> as=2
>>
>> � File "<stdin>", line 1
>> � � as=2
>> � � �^
>> SyntaxError: invalid syntax
> 
> I disagree. "Broken" is something you can't work
> around. In this case, simply saying as_=2 works fine.
> 
> A better example of broken was when the gmpy module
> wouldn't solve a certain linear congruence problem
> because the problem was not invertible. But
> mathematically, solving a linear congruence does
> NOT depend on the problem being invertible. It was
> the ALGORITHM that depended on the problem being
> invertible and there was nothing the user could do
> to make the algorithm behave properly. The algorithm
> had to be altered to fix the special case of a
> solvable linear congruence not being invertible.
> 
>>
>>
>> Making a former syntactically valid �two letter name a reserved word in
>> 2.6 was a mistake, IMHO.
> 
> I think you're in the minority there.
> 
I think that its special use is clear from the syntax, so IMHO it 
could've been left for Python 3, but I'm not going to lose any sleep 
over it.

>> What's next? What about making i,j,k, x and y
>> reserved words in 2.7? =:-/
> 
> Yeah, right. That'll happen. You ought to be more
> concerned about real problems.
> 



More information about the Python-list mailing list