mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 23:21:29 +00:00 
			
		
		
		
	gh-109653: Avoid a top-level import of types in functools (#109804)
				
					
				
			This commit is contained in:
		
							parent
							
								
									8d365b60ba
								
							
						
					
					
						commit
						40d1de7581
					
				
					 2 changed files with 4 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,2 @@
 | 
			
		|||
Improve import time of :mod:`functools` by around 13%. Patch by Alex
 | 
			
		||||
Waygood.
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue