[Python-ideas] Top 10 Python modules that need a redesign Was: Geo coordinates conversion in stdlib

Chris Kaynor ckaynor at zindagigames.com
Mon Apr 6 23:40:02 CEST 2015


On Mon, Apr 6, 2015 at 1:47 PM,  <random832 at fastmail.us> wrote:
> On Sat, Apr 4, 2015, at 00:18, Chris Angelico wrote:
>> There are many Pythons in the world. You can't just hack on CPython
>> and expect everything to follow on from there. Someone has to explain
>> to the Jython folks what they'll have to do to be compatible. Someone
>> has to write something up so MicroPython can run the same code that
>> CPython does.
>
> I thought that was the point of having pure python modules. If this
> can't be "figure it out, or use the pure python reference implementation
> already provided" then what's the point?

Many of the other Python instances may have optimized versions of the
libraries (CPython itself often does so, as does PyPy), or be using
APIs from their base language (Jython and IronPython are good
examples). In any of those cases, they have to update their
versions/wrappers to support the new documented behavior. One of the
points of a PEP is to document the changes so that those other
versions know what they must change in their libraries, which may not
be merely a port of the Python implementation. In fact, without a PEP
system, it is likely that the changes could just fall under the rug
and be completely missed, causing each implementation to have its
effectively have its own standard library version, none of which are
fully compatible with each other (and worse when may generally seem
compatible).

In addition to documenting the changes, the PEP process also allows
the maintainers of other implementations (as well as the CPython core
developers and anybody else interested) to officially provide feedback
and concerns about the purposed changes.

That all said, one of the common steps of PEP writing is to
fork/branch the CPython code base and create a reference
implementation of the proposal. The could be done merely by making a
PyPi package or other third-party library for simpler changes or
additions, or an actual fork/branch for more detailed or root changes
(such as attempts to remove the GIL or changing syntax).

Additionally, the pure python modules have other benefits. Namely,
they can act as a fallback for when the optimized C modules cannot
function, such as running on a platform which has not been fully
optimized for.

Chris


More information about the Python-ideas mailing list