mirror of
				https://github.com/python/cpython.git
				synced 2025-10-26 19:24:34 +00:00 
			
		
		
		
	 0dc8b50d33
			
		
	
	
		0dc8b50d33
		
			
		
	
	
	
	
		
			
			This speeds up `super()` (by around 85%, for a simple one-level `super().meth()` microbenchmark) by avoiding allocation of a new single-use `super()` object on each use.
		
			
				
	
	
		
			7 lines
		
	
	
	
		
			97 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			7 lines
		
	
	
	
		
			97 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| class super:
 | |
|     msg = "truly super"
 | |
| 
 | |
| 
 | |
| class C:
 | |
|     def method(self):
 | |
|         return super().msg
 |