backward/forward compatibility in PYTHON?
holger krekel
pyth at devel.trillke.net
Thu May 30 09:53:47 EDT 2002
Attila Horvath wrote:
> Dear PYTHON community,
>
> I'm new to PYTHON but am considering it for a new project development. As
> with any new language system I have a key concern:
>
> How is backward (and forward) compatibility resolved in PYTHON?
In many ways :-)
backward compatibility:
- several years (commonly 2) of fading out deprecated features.
- Deprecation warnings if a feature could be removed in the
next version.
- if you know you are using e.g. python2.2 features you might
want to code a one-line assertion like
asssert(sys.version_info[:2]>=(2,2))
- 'good practices' like not relying on the current cvs python
or weird sideeffects :-)
forward compatibility:
- new features are introduced via the
from __future__ import xyz
construct. This keeps your code at least parsable and usually
semantically the same.
- it should take two major releases to break old code
if the old code had no DeprecationWarnings.
Also if you want something to work from python1.5.2 to python2.3
you may have to learn about the common feature set of these
versions.
python3000 (or python3) may be a completly different matter of course :-)
holger
More information about the Python-list
mailing list