Question about Python
mwm at mired.org
Fri Jul 1 17:30:49 CEST 2005
Jan Danielsson <jan.danielsson at gmail.com> writes:
> Hello all,
> I'd like to ask seasoned Python developers:
> - Are you comfortable in upgrading to the latest version of Python, or
> are you worried about what you have to fix in your existing programs?
No, I'm not worried. The Python developers worry about not breaking
backwards compatability. The worst problem is third party extensions,
and those almost always work.
> - Put aside any unconditional love for Python for a second, and be
> honest: Have you ever run into version related problems?
Yes. I once grabbed an old program that did assignments to None. But
that's always been a bad idea.
> - Have you ever relied on a module, upgraded python version for some new
> important feature, but realized that the module you rely on hasn't been
> updated yet? If not, do you consider a possibility?
There are a couple of issues here.
Minor version updates (2.x.y to 2.x.y+1) seldom (never?) break
things. You can just keep using the old modules.
Major version updates (2.x to 2.x+1) seldom break pure python
modules. However, the libraries are in a different place, so you'll
have to reinstall the module. You could just add the old library
directory to PYTHONPATH, but I don't really trust that.
Major version updates almost always break python extension
modules. However, it's usually just a binary
incompatability. Recompiling the old source will produce a module that
works on the new version.
If you rely on others for your binary modules, you're at their mercy.
If you build your own binaries modules, you'll be fine
> - Do the module developers, in general, keep up with the development
> versions of python, so you can expect to find newly updated modules as
> new versions of python hits the streets?
I don't look for updated versions of modules when I upgrade Python.
When doing a minor version upgrade, I just do upgrade Python.
When doing a major version upgrade, I get a list of installed python
modules from my package manager, then reinstall all of them. That
fetches any new versions that have made it into the package system,
and rebuilds binary extensions. Most things just work. The only
problems I've had doing this was because a new version of the C++
compiler choked on an expression in the C++ code of a module. A quick
mail to the module support group got a patch for the C++ code, and
that built just fine.
I have more worries about upgrading third party modules breaking my
code than I do about upgrading Python breaking my code.
> - Did you have similar worries to mine when you started working with Python?
Yes, based on experience with other languages. I've been pleasantly
Mike Meyer <mwm at mired.org> http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
More information about the Python-list