[Python-Dev] Backwards Incompatibility

Thomas Wouters thomas@xs4all.net
Wed, 21 Feb 2001 23:33:34 +0100


On Wed, Feb 21, 2001 at 04:53:21PM -0500, Jeremy Hylton wrote:

> When we unleashed Python 2.1a1, there was a fair amount of discussion
> about nested scopes on python-dev and on python-list.

Nested scopes weren't in 2.1a1, they were added between 2.1a1 and 2.1a2.

> The fact that code would break has been documented in the PEP since
> December, before the BDFL pronounced on it.

The PEP only mentions one type of breakage, a local vrbl in an upper scope
shadowing a global. It doesn't mention exec or from-module-import-*. I don't
recall seeing a BDFL pronouncement on this issue, though I did whine about
the whole thing from the start ;-P

> I've heard plenty of hypothetical howls and one real one, from Mark.

Don't forget that the std. library itself had to be fixed in several places,
because it violated the reference manual. Doesn't that hint that there is
much more code out there that uses it ? I found two instances myself in old
first-attempt GUI scripts of mine, which I never finished and thus aren't
worth much more than the hypothetical howls. This is like spanking the
dog/kid for doing something bad he had no way of knowing was bad. You can't
expect the dog or the kid to read up on federal law to make sure he isn't
doing anything bad by accident.

Besides from any real problems we'll see, the added wartiness (which is what
the hypothetical howls are all about) does really matter. What are we trying
to solve with nested scopes ? Anything other than the default-argument hack
wart ? Aren't we adding more warts to fix that one wart ?

-- 
Thomas Wouters <thomas@xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!