We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ba86157 commit 5ddfc47Copy full SHA for 5ddfc47
test-data/unit/check-overloading.test
@@ -6782,3 +6782,28 @@ def f(x: B) -> int: ... # E: Overloaded function signatures 1 and 2 overlap wit
6782
@overload
6783
def f(x: T) -> str: ...
6784
def f(x): ...
6785
+
6786
6787
6788
+[case testOverloadOnManyTypeVariablesGenericClassDoesNotSignificantlyDegradePerformance]
6789
+from typing import Generic, TypeVar, overload
6790
6791
+class A: pass
6792
6793
+class B: pass
6794
6795
+class C: pass
6796
6797
+T1 = TypeVar("T1", A, B, C)
6798
+T2 = TypeVar("T2", A, B, C)
6799
+T3 = TypeVar("T3", A, B, C)
6800
+T4 = TypeVar("T4", A, B, C)
6801
+T5 = TypeVar("T5", A, B, C)
6802
+T6 = TypeVar("T6", A, B, C)
6803
6804
+class Container(Generic[T1, T2, T3, T4, T5, T6]):
6805
+ @overload
6806
+ def f(self, t1: int, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6) -> int: ...
6807
6808
+ def f(self, t1: str, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6) -> str: ...
6809
+ def f(self, t1, t2, t3, t4, t5, t6): ...
0 commit comments