[issue30152] Reduce the number of imports for argparse

Wolfgang Maier report at bugs.python.org
Wed Apr 26 04:21:03 EDT 2017


Wolfgang Maier added the comment:

@rhettinger: I do not quite understand this harsh reaction. Making argparse more responsive could, in fact, be quite a nice improvement. This is particularly true, I guess, if you want argument completion with a package like https://pypi.python.org/pypi/argcomplete.

You have a point that the patch probably tries to optimize too many things in too many places at once, but that could be amended rather easily.

The idea of delaying imports in argparse itself to when they are actually needed is a really good one and, for this module, it is also very reasonable that other places in the stdlib only import it when they are run as __main__.

----------

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


More information about the Python-bugs-list mailing list