Hi there,

On Fri, Dec 9, 2011 at 4:18 PM, Bengt Richter <[email protected]> wrote:

> PMJI, but I was thinking that if you had both py272 and py3k modules it
> would seem
> natural to keep them in separate directories,

True, I imagine you'd normally give them different module names. The
standard library however is a clear example where there is potential
for overlap.

That's why I thought it would be simpler to have separate module
spaces entirely and have an import2() in Python 3 and an import3() in
Python 2 to import from the other place. I.e. baz= import3('foo.bar',
'baz') as the equivalent of a 'from... import'.

You'd still need a way for the system to know which modules and
packages are Python 2 and which are in Python 3. I imagine they'd
share the same PYTHONPATH. I figure some kind of global dictionary
with this information, and various ways to fill it (with a
module-level declaration, a package level declaration in __init__, or
completely externally through an API for the case when the library
itself makes no such declaration - the latter would be the most
compatible). If done on a package level, combined with a default
setting, the burden shouldn't be too onerous for the developer.

Regards,

Martijn
_______________________________________________
pypy-dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to