[Python-Dev] again on nested scopes and Backwards Incompatibility

Samuele Pedroni Samuele Pedroni <pedroni@inf.ethz.ch>
Thu, 22 Feb 2001 00:25:15 +0100 (MET)


Hi.

This my last effort for today ;).

[Thomas Wouters]
> On Wed, Feb 21, 2001 at 05:41:41PM -0500, Andrew Kuchling wrote:
> 
> > Compatibility... ay, there's the rub!
> 
> If you include 'ways of thinking' in 'compatibility', I'll agree. Many
> people are used to being able to use exec/from-foo-import-*, and consider it
> part of Python's wonderful flexibility and straightforwardness (I know I do,
> and all my python-proficient and python-learning colleagues do.)
> 

1) I'm convinced that on the long run that both:
- import *
- exec without in 
should be deprecated, so we could start issueing warning with 2.1 or 2.2
and make them errors when people get annoyed by the warnings enough ;)
This has nothing to do with nested scopes. So people have time
to change their mind.

2) The actual implementation of nested scopes (with or without compatibilty
hacks) is based on the assumption that
- one can detect lexically scoped variables as up 2.0 python was able
to detect local vars (without the need of explicit declarations) -,
and this is pythonic and neat, so let's do it.

But this thread and the matter of fact that with the implementation
some old code is not more valid or behave in a different way
shows that maybe (I say maybe) this assumption is not completely valid.

It is clear too that this difference between reality and theory has not
that big predictable consequences, it's just annoying for some among us.
But a survey among users to detect the extent of this has started.

But from the theoretical (and maybe PR?) viewpoint the difference
exists.

On the other hand the (potential) solution (wich I'm aware open some other 
subtle issues to discuss but keep old code working as it was) of using some kind 
of explicit declarations is a no-go, no-story. Yes is not that much pythonic...

Is'nt it possible to be all happy?

I'm wondering if we have not transformed in an holy war a problem
that offer at least some space for a technical discussion.

regards, Samuele Pedroni.

PS: sorry for my abuse of we given that I'm jython devel not a python one,
but it is already difficult so... I feel I'm missing something about
this group dynamics.