On Sun, Oct 13, 2013 at 3:08 PM, Victor Stinner <victor.stin...@gmail.com>wrote:
> Le 13 oct. 2013 10:19, "Stefan Behnel" <stefan...@behnel.de> a écrit : > > > I agree. I find it much easier to read a plain and obvious > > > > try: > > from _cmodule import * > > except ImportError: > > from _pymodule import * > > > > in a facade module ... > > I miss maybe something. I don't understand why you would like to use the > Python implementation if a C implementation is available and probably > (much) faster. > > Maybe developers of PyPy, IronPython and Jython appreciate our effort to > provide a Python implementation which is up to date and well tested. But > why should we pay a price (bad performance) if the module is not (never? > who uses _pyio?) used in CPython. If another Python uses it, the file can > be renamed (ex: _pyio.py becomes simply io.py). > Because doing a rename like that is a deviation between implementations that saves you nothing more than a file with four lines. And "bad performance" in this instance is a single import * which in the grand scheme of things is cheap, especially in this instance where the module is not on the critical path (and even if it was I would argue it isn't worth worrying about). > IMO if the C module is complete (has no extra functions in the "facade" > module), it should get the main name (ex: decimal, not _decimal). > Why? It's not the reference implementation as that's the pure Python version, but your suggested naming scheme purports the opposite. -Brett
_______________________________________________ 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