On Wed, Oct 13, 2010 at 12:13 PM, Seebs <usenet-nos...@seebs.net> wrote:
> On 2010-10-13, Chris Torek <nos...@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-nos...@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 >
-- http://mail.python.org/mailman/listinfo/python-list