Skip to content

Commit

Permalink
pythongh-109653: Avoid a top-level import of types in functools (p…
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexWaygood authored and Glyphack committed Jan 27, 2024
1 parent a899d06 commit f8e689e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Lib/functools.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
# import types, weakref # Deferred to single_dispatch()
from reprlib import recursive_repr
from _thread import RLock
from types import GenericAlias

# Avoid importing types, so we can speedup import time
GenericAlias = type(list[int])

################################################################################
### update_wrapper() and wraps() decorator
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Improve import time of :mod:`functools` by around 13%. Patch by Alex
Waygood.

0 comments on commit f8e689e

Please sign in to comment.