New PEP: The directive statement

Andrew Kuchling akuchlin at mems-exchange.org
Thu Mar 22 16:23:09 EST 2001


Piet van Oostrum <piet at cs.uu.nl> writes:
> future_statement. But if you remove it after the feature has become
> standard your new modules that use the new division semantics become
> ambiguous. Suppose you have to use Python 1.5.2. or 2.0 because that's all
> your ISP provides. 

Backward incompatible changes have happened before; consider the
str(5L) -> '5' instead of '5L' change in 1.6, which made some 1.5.2
code produces incorrect results.  The __future__ stuff provides a way
to make the transition take longer, but more abrupt transitions have
been made in the past.

It's really a documentation issue; people who release software should
say "I've tested this with Python 2.0", and people with 1.5.2 or 2.1
will have to look out, and perhaps provide patches to fix problems.

> And you have this nifty module that someone wrote. How
> do you know what the semantics of division is in that module? It would be
> much better if the module indicated that it uses the new semantics, for the
> ages to come.

But then, 5 years from now, we'll be stuck with 'from __future__
import interfaces', plus 5 more years of cruft, in all our modules,
and after a few years, no one will consider the semantics novel.
Tools/scripts/classfix.py converts class definition syntax from the
pre-0.9.8 syntax to the current syntax; no one cares about this any
longer.

--amk



More information about the Python-list mailing list