[Python-3000] exclusion feature for 2to3?
alexandre at peadrop.com
Wed Jul 18 23:43:54 CEST 2007
On 7/15/07, Georg Brandl <g.brandl at gmx.net> wrote:
> Most obvious would be a special comment, something like
> for x in curiousobject.iteritems(): # 2to3:keep
> Does that make sense?
It would be a good idea to define a convention for these special
comments. For example, we could define something similar to C's
#pragma <feature> <option> ...
#: <feature> <option> ...
So, your example would become:
for x in curiousobject.iteritems(): #pragma 2to3 keep
I expect other tools, like pdb.py and trace.py could follow this
convention as well. For example:
def buggy_func(): #pragma pdb break
if debug: #pragma trace ignore
The motivation for making a such convention, is to make it easy for
programmers to identify comments that are in fact control lines.
More information about the Python-3000