[PATCH 5 of 7] setup: support executing with python3 including 2to3

Matt Mackall mpm at selenic.com
Wed Nov 9 12:47:43 CST 2011


On Wed, 2011-11-09 at 12:52 +0400, Sjujskij Nikolaj wrote:
> >> Wouldn't
> >>     print("warning: IronPython detected (no bz2 support)")
> >> work everywhere?
> > Yes, that's one typical Py2- and Py3-compatible way of using print.
>   Excuse me guys, but that would break Pythons 2.{4,5}.*, or do I miss
> something? And `from __future__ import print_function` wouldn't work
> there neither.

$ python2.4
Python 2.4.6 (#2, Sep 25 2009, 22:22:06) 
[GCC 4.3.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> print("foo")
foo
>>> print-1
-1

This is a natural result of how 'lexing' works in a parser.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list