File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed
Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -1199,8 +1199,6 @@ def _match_subst_against_subst(
11991199 old_subst .copy (t = b1 .AssignToNewVariable (self ._node )),
12001200 )
12011201 else :
1202- # If t isn't a TypeVar here it should be a ParamSpec
1203- assert t in self ._paramspecs
12041202 new_var = self .ctx .program .NewVariable ()
12051203 new_var .PasteBindingWithNewData (
12061204 b2 , self .ctx .convert .get_maybe_abstract_instance (b2 .data )
Original file line number Diff line number Diff line change @@ -611,6 +611,25 @@ def f(x: int, y) -> Any: ...
611611 """ ,
612612 )
613613
614+ def test_paramspec_in_callable_as_param_not_fail (self ):
615+ self .Check ("""
616+ from typing import ParamSpec, Callable
617+
618+ _P = ParamSpec("_P")
619+ LogTextFn = Callable[_P, None]
620+
621+ class ModelHandlerInterface:
622+ def __init__(self, log_text: LogTextFn, log_code: LogTextFn):
623+ pass
624+
625+ class GeminiModelHandler(ModelHandlerInterface):
626+ def __init__(self, log_text: LogTextFn, log_code: LogTextFn):
627+ super().__init__(
628+ log_text,
629+ log_code,
630+ )
631+ """ )
632+
614633
615634class ContextlibTest (test_base .BaseTest ):
616635 """Test some more complex uses of contextlib."""
You can’t perform that action at this time.
0 commit comments