Oscar Benjamin, 13.10.2013 18:35: > CPython preferentially imports extension modules over .py modules with > the same name. This is what happens when you use Cython in "pure" > mode: You have a pure mod.py file and an "augmenting" mod.pxd that > contains the annotations relevant to Cython. The resulting extension > module is mod.{pyd,so} and is imported by CPython if present. This way > you don't need an additional directory/module.
While it may work, I wouldn't really recommend that for manually written modules. For Cython, it's a nice feature because you get the same thing, just in native code. It also helps with stack traces because Python can extract the source code lines for exceptions raised in native code from the original .py file. For manually written modules, the source code is naturally unrelated between both implementations. You want to test both separately and may even want to import one or the other specifically for other reasons. Explicitly given them different names is very helpful here. Stefan _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com