R
Rustom Mody
This is fine advice for applications, but tools, libraries, and
frameworks may want to support more than one version at the same time.
It's an extreme case, but the latest released version of coverage.py
supports Python 2.3 through 3.3 with one code base. To do it, there's a
compatibility layer (akin to six). Then you stay away from features
that aren't available on all versions. In a few places, you might need
to have version checks, and the code can get a little idiomatic to
continue to work.
It's a tradeoff: you have to decide for yourself whether the effort is
worth the benefit. I was glad to be able to drop support for 2.3, 2.4,
and 2.5, and now only support 2.6-3.4 in coverage.py.
Ned is talking to (and from) a lib-writer perspective
Marko is talking from noob perspective (which is what the OP looks like)
Good to choose our hats appropriately