This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author hfuru
Recipients hfuru, loewis
Date 2010-10-12.15:14:46
SpamBayes Score 8.301841e-10
Marked as misclassified No
Message-id <hbf.20101012jh7w@bombur.uio.no>
In-reply-to <1286892685.06.0.886216583275.issue10070@psf.upfronthosting.co.za>
Content
> 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.
History
Date User Action Args
2010-10-12 15:14:49hfurusetrecipients: + hfuru, loewis
2010-10-12 15:14:47hfurulinkissue10070 messages
2010-10-12 15:14:46hfurucreate