diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2017-09-25 21:55:55 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-25 21:55:55 (GMT) |
commit | 81108375d9b2ccd0add1572da745311d4dfac505 (patch) | |
tree | 54632e1d6ec58850f70941452634c4faf1ea7218 /Lib/types.py | |
parent | f1502d097c29b266a5748312ee2451a2d6ac0af6 (diff) | |
download | cpython-81108375d9b2ccd0add1572da745311d4dfac505.zip cpython-81108375d9b2ccd0add1572da745311d4dfac505.tar.gz cpython-81108375d9b2ccd0add1572da745311d4dfac505.tar.bz2 |
bpo-30152: Reduce the number of imports for argparse. (#1269)
Diffstat (limited to 'Lib/types.py')
-rw-r--r-- | Lib/types.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/types.py b/Lib/types.py index 929cba2..336918f 100644 --- a/Lib/types.py +++ b/Lib/types.py @@ -172,9 +172,6 @@ class DynamicClassAttribute: return result -import functools as _functools -import collections.abc as _collections_abc - class _GeneratorWrapper: # TODO: Implement this in C. def __init__(self, gen): @@ -247,7 +244,10 @@ def coroutine(func): # return generator-like objects (for instance generators # compiled with Cython). - @_functools.wraps(func) + # Delay functools and _collections_abc import for speeding up types import. + import functools + import _collections_abc + @functools.wraps(func) def wrapped(*args, **kwargs): coro = func(*args, **kwargs) if (coro.__class__ is CoroutineType or |