2010/12/23 "Martin v. Löwis" <mar...@v.loewis.de>: >> # "a?b:c" to "test(a,b,c)". >> expr = re.compile(r'(.*?)\?(.*?):(.*)') >> def repl(x): >> - return "test(%s, %s, %s)" % (x.group(1), x.group(2), >> - expr.sub(repl, x.group(3))) >> + return "(%s if %s else %s)" % (x.group(2), x.group(1), >> + expr.sub(repl, x.group(3))) > > Please update the comment as well.
Done. -- Regards, Benjamin _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com