mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 05:31:20 +00:00 
			
		
		
		
	[3.9] bpo-46469: Make asyncio generic classes return GenericAlias (GH-30777) (GH-30785)
Automerge-Triggered-By: GH:asvetlov
This commit is contained in:
		
							parent
							
								
									3c4a3745b9
								
							
						
					
					
						commit
						6ed874f8c5
					
				
					 8 changed files with 29 additions and 24 deletions
				
			
		|  | @ -3,6 +3,7 @@ | |||
| import collections | ||||
| import heapq | ||||
| import warnings | ||||
| from types import GenericAlias | ||||
| 
 | ||||
| from . import events | ||||
| from . import locks | ||||
|  | @ -76,8 +77,7 @@ def __repr__(self): | |||
|     def __str__(self): | ||||
|         return f'<{type(self).__name__} {self._format()}>' | ||||
| 
 | ||||
|     def __class_getitem__(cls, type): | ||||
|         return cls | ||||
|     __class_getitem__ = classmethod(GenericAlias) | ||||
| 
 | ||||
|     def _format(self): | ||||
|         result = f'maxsize={self._maxsize!r}' | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Kumar Aditya
						Kumar Aditya