Hallvard B Furuseth <h.b.furus...@usit.uio.no> added the comment: > Maybe we need to tackle this from a different angle: can you please > specify the feature you are asking for exactly, with any syntax, API, or > command line changes that you consider necessary?
First, nothing here is necessary, since it's just a request for a convenience. The syntax could be a generalization of the example I gave: <whatever>: # Python <version> <indented block> and <whatever>: # Python <version> <indented block> tell 2to3 "The code in <block> it is expected to only run (or succeed) in Python <version>. Do not modify it, except it is an error if it is a syntax error under Python 3 so the script won't even run". '<whatever>:' can be some if,else,try,except, I don't know what else, and is responsible for making different Python versions do the right thing. > Omitting redundant parentheses for print is a separate issue (feel > free to open an issue); we should not mix it with this issue (which > I still don't understand). OK. But I don't understand what you don't understand... I have some Python 2 files in various stages of transition to be runnable and correct in Python 3, while still working in Python 2. It'd be convenient if the parts that do work under both Python 2 and 3 could be written so that 2to3 would be silent about them, without need for different 2to3 command line options for different .py files. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue10070> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com