mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 23:21:29 +00:00 
			
		
		
		
	
		
			
	
	
		
			15 lines
		
	
	
	
		
			280 B
		
	
	
	
		
			Python
		
	
	
	
	
	
		
		
			
		
	
	
			15 lines
		
	
	
	
		
			280 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| 
								 | 
							
								# Test ``inspect.formatannotation``
							 | 
						||
| 
								 | 
							
								# https://github.com/python/cpython/issues/96073
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								from typing import Union, List
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								ann = Union[List[str], int]
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								# mock typing._type_repr behaviour
							 | 
						||
| 
								 | 
							
								class A: ...
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								A.__module__ = 'testModule.typing'
							 | 
						||
| 
								 | 
							
								A.__qualname__ = 'A'
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								ann1 = Union[List[A], int]
							 |