[Python-Dev] Change PEP 399 import recommendation (original) (raw)
Antoine Pitrou solipsis at pitrou.net
Sat Oct 12 19:02:43 CEST 2013
- Previous message: [Python-Dev] Change PEP 399 import recommendation
- Next message: [Python-Dev] Change PEP 399 import recommendation
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Sat, 12 Oct 2013 18:55:42 +0200 Christian Heimes <christian at python.org> wrote:
Am 12.10.2013 17:37, schrieb Nick Coghlan: > I think the default recommendation in PEP 399 still makes sense - 2 > modules are easy to manage than three and the idiom allows for easy > partial replacement.
We could ues yet another approach and put the pure Python implementation of modules into another directory (e.g. Lib/pystdlib or Lib/purepython). This directory is appended to sys.path. Alternative implementations of Python or platforms without the necessary bits and pieces would import the Python-only version from that directory. C modules can be renamed so CPython picks them up in favor of the pure Python modules. No hacks, no facade module, no slow down and it's easy to understand, too.
If you grow sys.path, imports get slower. (IMHO it also makes the source tree more cumbersome to navigate)
Regards
Antoine.
- Previous message: [Python-Dev] Change PEP 399 import recommendation
- Next message: [Python-Dev] Change PEP 399 import recommendation
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]