Re: [Python-Dev] Change PEP 399 import recommendation

2013年10月13日 04:47:37 -0700

Stefan Behnel <[email protected]> wrote:
> in a facade module than
> 
> # lots and lots
> # of unused
> # Python code
> # here ...
> 
> # ... and then this, well hidden at the end, telling
> # me that I just waded through the entirely wrong code:
> 
> try:
> from _cmodule import *
> except ImportError:
> pass
I don't care much about the directory versus facade module approach, but the
above is really worth noting. For decimal, I find the three-files approach
easier to manage: All private symbols of the Python version are automatically
no longer imported; they don't have to be deleted when the C version is
used. Also, the new scheme uncovered some missing symbols in __all__.
The downside for CPython is just a slightly more cluttered directory listing
(and the doctests get a bit messier).
The other implementations could import their (hypothetical) accelerators
in the facade module and override selected symbols there (I think Nick
mentioned that already).
Stefan Krah
_______________________________________________
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to