GOTCHA with list comprehension

Chris Angelico rosuav at gmail.com
Thu Aug 6 00:44:15 EDT 2015


On Thu, Aug 6, 2015 at 2:39 PM, Laura Creighton <lac at openend.se> wrote:
> In a message of Wed, 05 Aug 2015 17:05:49 +1000, Chris Angelico writes:
>>Incidentally, why Python 2.6? Python 2.7 has been out for a pretty
>>long time now, and if you can't move to version 3.x, I would at least
>>recommend using 2.7. Since the release of 2.6.9 back before Frozen
>>came out, that branch has been completely unmaintained. Grab yourself
>>a 2.7 and take advantage of some neat new features (for old values of
>>"new"), and improved compatibility with 3.x.
>>
>>ChrisA
>
> Be careful suggesting that people upgrade, at least until you have
> found out that they aren't running CentOS enterprise edition. The
> CentOS packaging system is utterly dependent on having the Python
> version it expects, and if you install a more recent version
> (from source, say) the whole packaging system will stop working.
> Recovering from this problem is also very, very difficult  (unless
> you just restore from a recent full backup).
>
> Been there, done that. :(

Yeah. Fortunately there are ways to leave the system Python untouched
while adding in another Python for some other purpose... and, if
you're desperate enough, you can even leave the Apache-Python bridge
using an older build of Python while running key parts of your web
application in a newer version,  but that requires a certain measure
of insanity!

There will come a time, though, when every supported Linux distro is
shipping either 2.7 or 3.x. And it isn't far off. When that happens,
advising the upgrade will be simple.

ChrisA



More information about the Python-list mailing list