[Python-Dev] Merging Jython code into standard Lib [was Re: Python Language Summit at PyCon: Agenda]

Brett Cannon brett at python.org
Sat Mar 2 16:58:47 CET 2013


On Sat, Mar 2, 2013 at 10:28 AM, Antoine Pitrou <solipsis at pitrou.net> wrote:

> On Sun, 3 Mar 2013 01:17:35 +1000
> Nick Coghlan <ncoghlan at gmail.com> wrote:
> >
> > I'd go further and say we *should* move to that solution.
> >
> > Here's an interesting thought: for pure C modules without a Python
> > implementation, we can migrate to this architecture even *without*
> > creating pure Python equivalents. All we shou;d have to do is change
> > the test of the pure Python version to be that the module *can't be
> > imported* without the accelerator, rather than the parallel tests that
> > we normally implement when there's a pure Python alternative to the
> > accelerated version. (There would likely still be some mucking about
> > to ensure robust pickle compatibility, since that leaks implementation
> > details about exact module names if you're not careful)
>
> What benefit would this have?
>
> Current situation: each Python implementation has its own
> implementation of the zlib module (as a C module for CPython, etc.).
>
> New situation: all Python implementations share a single, mostly empty,
> zlib.py file. Each Python implementation has its own implementation of
> the _zlib module (as a C module for CPython, etc.) which is basically
> the same as the former zlib module.
>

Bare minimum? They all share the same module docstring. But it could be
extended to explicitly import only the public API into zlib.py, helping to
prevent leaking interpreter-specific APIs by accident (obviously would
still be available off of _zlib if people wanted them).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20130302/f88314dc/attachment-0001.html>


More information about the Python-Dev mailing list