[issue30152] Reduce the number of imports for argparse

INADA Naoki report at bugs.python.org
Mon Sep 25 06:18:07 EDT 2017


INADA Naoki added the comment:

Oh, the pull request is far larger than I thought!

I doubt that avoiding functools and collections is worth enough, because it is very common.

For example:

* functools is very commonly imported, especially for wraps().

* collections is imported by functools, so it's more commonly imported than functools.

* Old style namespace package (.pth file) imports types module, and types module and types imports functools, collections.  So even `python -c 42` imports them if at least one old-style namespace package is installed.  (e.g. Sphinx)


Instead of avoiding them, I want to make them faster.

* C implementation of ABC will makes collection, weakref and some other modules much faster.
* Recent PEP will allows split functools module into submodules without breaking backward compatibility.

----------
nosy: +inada.naoki

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue30152>
_______________________________________


More information about the Python-bugs-list mailing list