Message108023
| Author |
belopolsky |
| Recipients |
amaury.forgeotdarc, belopolsky, brett.cannon, brian.curtin, daniel.urban, lemburg, pitrou, r.david.murray, techtonik, vstinner |
| Date |
2010年06月17日.14:45:20 |
| SpamBayes Score |
0.013839376 |
| Marked as misclassified |
No |
| Message-id |
<1276785923.86.0.644517738208.issue7989@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
On Thu, Jun 17, 2010 at 10:31 AM, Marc-Andre Lemburg <report@bugs.python.org> wrote:
..
> To avoid the wasted memory and import time, it's better to use:
>
> try:
> from _cmodule import *
> except ImportError:
> from _pymodule import *
>
Hmm, I cannot find the relevant thread, but I thought this was rejected at some point. Personally, I don't like this at all for the following reasons:
1. This introduces two _.. names instead of one.
2. This departs from established convention that C (or native) implementation for modulename is in _modulename, not _cmodulename. Non-C implementations may still provide native _modulename, but would not want to call it _cmodulename.
3. Hiding python code in _pymodule makes it harder to find it.
..
> Why not import the two modules directly ?
>
> import _cmodule as module
> and
> import _pymodule as module
>
Because this requires having two modules in the first place. |
|