How to break? (was Re: A modest PEP0238 suggestion)

Terry Reedy tjreedy at home.com
Sat Jul 28 13:52:07 EDT 2001


"Aahz Maruch" <aahz at panix.com> wrote in message
news:9jun6j$c5$1 at panix2.panix.com...
> Phrased that way, I think it *has* to be true that there is never a
> future in which old code can break silently.

It is the nature of semantic substitutions to silently break code in
either the forward or backward directions.  Unfortunately, in a
language with runtime compilation (of user imput, for instance) any
feature addition implicity substitutes 'do the new thing' for 'raise
exception' .  The addition of 'yield expression' may silently break
programs that compile user-input into Python functions.  Bug fixes may
silently break programs that compensate for the bug.

One way to never break code, silently or otherwise, is to never change
the interpreter.

Another is to make current behaviour (including bugs) the default
forever and forever require explicit import of every change ever made
since freeze time, with runtime compilations handled separately.

Another is to go ahead and make new meanings the default but forever
identify every construct that once had a different meaning and issue a
warning so that the change is never completely silent.

Any others?

Terry J. Reedy






More information about the Python-list mailing list