mirror of
				https://github.com/python/cpython.git
				synced 2025-10-30 21:21:22 +00:00 
			
		
		
		
	
		
			
	
	
		
			23 lines
		
	
	
	
		
			324 B
		
	
	
	
		
			Python
		
	
	
	
	
	
		
		
			
		
	
	
			23 lines
		
	
	
	
		
			324 B
		
	
	
	
		
			Python
		
	
	
	
	
	
|   | from __future__ import annotations | ||
|  | from typing import Callable | ||
|  | 
 | ||
|  | 
 | ||
|  | class A[T, *Ts, **P]: | ||
|  |     x: T | ||
|  |     y: tuple[*Ts] | ||
|  |     z: Callable[P, str] | ||
|  | 
 | ||
|  | 
 | ||
|  | class B[T, *Ts, **P]: | ||
|  |     T = int | ||
|  |     Ts = str | ||
|  |     P = bytes | ||
|  |     x: T | ||
|  |     y: Ts | ||
|  |     z: P | ||
|  | 
 | ||
|  | 
 | ||
|  | def generic_function[T, *Ts, **P]( | ||
|  |     x: T, *y: *Ts, z: P.args, zz: P.kwargs | ||
|  | ) -> None: ... |