[pypy-dev] How to organize the py3k branch (was: [pypy-commit] pypy py3k: Remove print statement)

William ML Leslie william.leslie.ttg at gmail.com
Thu Oct 13 12:47:45 CEST 2011

On 13 October 2011 19:55, Antonio Cuni <anto.cuni at gmail.com> wrote:
> - support for py2 and py3 in the same branch, with minimal duplication of
> code.  This would mean that e.g. in ast.py you would have tons of "if py2:
> enable_print_stmt()", etc.  Personally, I think that the codebase would
> become too cluttered.

In order to support __future__.print_function, you already need this
case.  Do we have a good idea of where we expect the biggest
divergence?  Is it things that now return iterables or views, or is it
IO?  Is it new-style defaults, or unicode field names?

> - support for py2 and py3 in the same branch, with some duplication of code;
> e.g., we could copy the existing interpreter/ into interpreter/py3k and
> modify it there.  While we are at it, we should try hard to minimize the
> code duplication, but then it's up to us to decide when it's better to
> duplicate or when it's better to share the code between the twos.

An adaptive approach sounds very sensible.

William Leslie

More information about the pypy-dev mailing list