My first Python program

Chris Kaynor ckaynor at zindagigames.com
Wed Oct 13 15:27:36 EDT 2010


On Wed, Oct 13, 2010 at 12:13 PM, Seebs <usenet-nospam at seebs.net> wrote:

> On 2010-10-13, Chris Torek <nospam at torek.net> wrote:
> > Unfortunately "with" is newish and this code currently has to
> > support python 2.3 (if not even older versions).
>
> I think it might be 2.4 and later.  I'm not sure.  Of course, this being
> the real world, the chances that I'll be able to stick with "Python 2" and
> not have to simultaneously also support Python 1 and Python 3 are probably
> about 20%.
>

I'm fairly sure the with statement was first added in 2.5. In 2.5, you need
to use "from __future__ import with_statement" to enable it - in 2.6 it is
always enabled (the future import is still allowed for backwards
compatibility, but it does nothing).


>
> -s
> --
> Copyright 2010, all wrongs reversed.  Peter Seebach /
> usenet-nospam at seebs.net
> http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
> http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
> I am not speaking for my employer, although they do rent some of my
> opinions.
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20101013/760d6960/attachment-0001.html>


More information about the Python-list mailing list