mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 10:48:32 +00:00
[ty] Fix false positives for legacy ParamSpec
s inside Callable
type expressions (#18426)
This commit is contained in:
parent
e2d96df501
commit
47698883ae
2 changed files with 35 additions and 30 deletions
|
@ -264,10 +264,9 @@ from typing_extensions import ParamSpec
|
|||
|
||||
P2 = ParamSpec("P2")
|
||||
|
||||
# TODO: Not an error; remove once `ParamSpec` is supported
|
||||
# error: [invalid-type-form]
|
||||
# TODO: argument list should not be `...` (requires `ParamSpec` support)
|
||||
def _(c: Callable[P2, int]):
|
||||
reveal_type(c) # revealed: (...) -> Unknown
|
||||
reveal_type(c) # revealed: (...) -> int
|
||||
```
|
||||
|
||||
## Using `typing.Unpack`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue