"as" keyword woes

Mensanator mensanator at aol.com
Sat Dec 6 17:36:07 EST 2008


On Dec 6, 2:09�pm, Wolfgang Strobl <ne... at mystrobl.de> wrote:
> Mensanator <mensana... at aol.com>:
>
>
>
>
>
> >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.
>
> Well, that language change _did_ break the OPs code, and he already
> explained why it isn't as simple to work around as you obviously happen
> to believe.

It was extremely simple for me to fix the sympy
module where I noticed it. I'm not saying it
wasn't a problem, I'm saying it wasn't BROKEN.
And no, I couldn't use sympy after the fix
because apparently there is some change the way
2.6 hashes which truly breaks the sympy code, so
no using sympy with 2.6 until a corrected version
is released. And the real problem is that the
latest version was released without ever testing it
under 2.6. Hopefully, that won't happen again.

> � Calling it "not a SYNTAX error" is not only mistaken, it's
> weaseling around the problem too.

It's not weaseling around the problem, it's rating
the seriousness of the problem. Right now if I need
sympy, I HAVE to use 2.5, if I need itertools.permutations
I HAVE to use 2.6. But I canot use both in the same
program which is a tad more serious than having to
rename a variable I had business using in the first place.

>
> >In this case, simply saying as_=2 works fine.
>
> Certainly not, for example when that name is already used outside your
> control. In addition, you'll have to find all places, where the now
> syntactically illegal name is or might be used. This can get arbitrarily
> hard in generated �or foreign code.

The difficulty of fixing it isn't the issue, it's
whether it can be fixed at all.

>
>
>
> >A better example of broken was when the gmpy module
> >wouldn't solve a certain linear congruence problem
> >because the problem was not invertible.
>
> What does that have to to with anything?

It's an example of what it means to be BROKEN,
and yes, nothing at all to do with SYNTAX.

> We're disussing a language
> change on the syntax level which breaks existing legal code, not how a
> numerical library behaves for borderline cases.

And yet, you don't consider this a case of "weasel words".

Strange.

>
> [...]
>
> >> 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.
>
> Perhaps. Does that matter?

Yeah, if you think it will be resolved in your favor.

>
> >> What's next? What about making i,j,k, x and y
> >> reserved words in 2.7? =:-/
>
> >Yeah, right. That'll happen.
>
> Certainly not. �On the other hand, I was quite flabbergasted by the
> change in question, likewise. Wasn't that something �reserved for 3.0:
> breaking code mercilessly? �

Mercilessly? If there were no deprecation warnings,
you might have a case there. You act as if the failure
to display such warnings was deliberate, but that was due
to a BUG, not merciless behaviour on the part of the
developers.

> What is 3.0 good for, when we have to bear
> such breakage in a minor release, already?

You're making a mountain out of a molehill.

>
> >You ought to be more
> >concerned about real problems.
>
> It is a real problem for the OP.

Who gave him permission to use 2.6? Is 2.5 suddenly
unavailable? Assholes like Microsoft pull stunts
like that, but Python.org doesn't.

If it's his code, he can easily fix it.

If it's someone else's code, he should be using
a version guaranteed to work in 2.6.

>
> --
> Thank you for observing all safety precautions



More information about the Python-list mailing list