Re: [Tutor] combining Python 2.x and Python 3

2009-03-18 Thread Paul McGuire
These are very interesting links, and I just downloaded the evoque code to see how they handled the one "impossible" case that has stymied me in supporting pyparsing under Python 2.x (pre-2.6) and Python 3.0 with a single code base: exception handling. For those new to this topic, here is the prob

Re: [Tutor] combining Python 2.x and Python 3

2009-03-18 Thread Kent Johnson
On Wed, Mar 18, 2009 at 1:50 AM, wesley chun wrote: > wow, great links Kent. i didn't think that people would be as bold as > to do this, but i guess it was inevitable. > it may be worthwhile to collate all of > this info into a "2to3 FAQ" at some point. http://wiki.python.org/moin/PortingPythonT

Re: [Tutor] combining Python 2.x and Python 3

2009-03-17 Thread wesley chun
> I think the intent of 2to3 is that you maintain the > Python 2.6 version and automatically create the Python 3 version from > it. So there is only one source file. At least one person found this > practical, for a large codebase (well, he says it "mostly works"): > http://wiki.python.org/moin/Por

Re: [Tutor] combining Python 2.x and Python 3

2009-03-17 Thread Alan Gauld
"Andre Engels" wrote I have an open source project I have done some work on, which is programmed in Python 2.3-2.6. I would like to change it so that it can be run under both Python 3 and Python 2.x. That will be tricky. I think you can pretty much make Python 3 code that can run under v2.

Re: [Tutor] combining Python 2.x and Python 3

2009-03-17 Thread Kent Johnson
On Tue, Mar 17, 2009 at 3:54 PM, wesley chun wrote: >> I would like to change it so that it can be run under both Python 3 and >> Python 2.x. > > everyone who has responded so far are telling about converting your > piece of code from Python 2 to Python 3, for example, using the "2to3" > tool tha

Re: [Tutor] combining Python 2.x and Python 3

2009-03-17 Thread wesley chun
> I would like to change it so that it can be run under both Python 3 and > Python 2.x. everyone who has responded so far are telling about converting your piece of code from Python 2 to Python 3, for example, using the "2to3" tool that comes with Python 2.6+: http://docs.python.org/library/2to3.

Re: [Tutor] combining Python 2.x and Python 3

2009-03-17 Thread OkaMthembo
Apparently there's a tool to convert older Python code to Python 3 compatibility - is this what you want? Must be somewhere in the cheese shop - sorry i cannot recall the name, or where exactly i saw the discussion. Lloyd On Tue, Mar 17, 2009 at 1:33 PM, Andre Engels wrote: > I have an open sou

Re: [Tutor] combining Python 2.x and Python 3

2009-03-17 Thread Kent Johnson
On Tue, Mar 17, 2009 at 8:59 AM, Kent Johnson wrote: > There are quite a few porting anecdotes in blogs, etc. Some googling > should turn them up. Google "python 3 porting" for lots of resources. Kent ___ Tutor maillist - Tutor@python.org http://mail

Re: [Tutor] combining Python 2.x and Python 3

2009-03-17 Thread Kent Johnson
On Tue, Mar 17, 2009 at 7:33 AM, Andre Engels wrote: > I have an open source project I have done some work on, which is > programmed in Python 2.3-2.6. I would like to change it so that it can > be run under both Python 3 and Python 2.x. Two questions for that: > * is there a place where I can fin