[Python-Dev] Those import related syntax errors again...

Mark Hammond MarkH@ActiveState.com
Wed, 21 Feb 2001 16:27:44 +1100


[Jeremy]
> I'll buy that you're suffering at the moment, but I'm not sure why.

I apologize if I sounded antagonistic.

> You have a lot of code that uses 'from ... import *' inside
> functions.  If so, that's the source of the compatibility problem.
> If you had a tool that listed all the code that needed to be fixed
> and/or you got tracebacks that highlighted the offending line rather
> than some import, would you still be suffering?

The point isn't about my suffering as such.  The point is more that
python-dev owns a tiny amount of the code out there, and I don't believe we
should put Python's users through this.

Sure - I would be happy to "upgrade" all the win32all code, no problem.  I
am also happy to live in the bleeding edge and take some pain that will
cause.

The issue is simply the user base, and giving Python a reputation of not
being able to painlessly upgrade even dot revisions.


> It sounds like the
> problem wouldn't be much harder then multi-argument append at that
> point.

Yup.  I changed my code in relative silence on that issue, but believe we
should not have been so hasty.  Now we have warnings, I believe that would
have been handled slightly differently if done today.  It also had existing
documentation to back it.  Further, I believe that issue has contributed to
a "no painless upgrade" perception already existing in some people's minds.

> I also disagree strongly with the argument that nested scopes
> compromise the elegent simplicity of Python.  Did you really look at
> Python and say, "None of those stinking scoping rules.  Let me at it."
> <wink>  I think the new rules are different, but no more or less
> complex than the old ones.

exec and eval take 2 dicts - there were 2 namespaces.  I certainly have
missed nested scopes, but instead of "let me at it", I smiled at the
elegance and simplicity it buys me.

I also didn't have to worry about "namespace clashes", and obscure rules.  I
wrote code the way I saw fit at the time, and didn't have to think about
scoping rules.  Even if we ignore existing code breaking, it is almost
certain I would have coded the function the same way, got the syntax error,
tried to work out exactly what it was complaining about, and adjust my code
accordingly.  Python is generally bereft of such rules, and all the more
attractive for it.  So I am afraid my perception remains.

That said, I am not against nested scopes as Itrust the judgement of people
smarter than I.  However, I am against code breakage that is somehow "good
for me", and suspect many other Python users are too.

Just-one-more-reason-why-I-aint-the-BDFL-<wink> ly,

Mark.
Mark.