-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[red-knot] Allow all callables to be assignable to @Todo-signatures #17680
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
| def _(c: Callable[Concatenate[int, str, ...], int]): | ||
| reveal_type(c) # revealed: (*args: @Todo(todo signature *args), **kwargs: @Todo(todo signature **kwargs)) -> int | ||
| # TODO: Should reveal the correct signature | ||
| reveal_type(c) # revealed: (...) -> int |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we think that the signature should still reveal @Todo somehow, I can try to retain that property, by making is_gradual an enum or introducing another flag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to either keep ... or have @Todo(...) but not retain the current display as that's clearly incorrect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, keeping ... for now. Thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
* main: (37 commits) [red-knot] Revert blanket `clippy::too_many_arguments` allow (#17688) Add config option to disable `typing_extensions` imports (#17611) ruff_db: render file paths in diagnostics as relative paths if possible Bump mypy_primer pin (#17685) red_knot_python_semantic: improve `not-iterable` diagnostic [red-knot] Allow all callables to be assignable to @Todo-signatures (#17680) [`refurb`] Mark fix as safe for `readlines-in-for` (`FURB129`) (#17644) Collect preview lint behaviors in separate module (#17646) Upgrade Salsa to a more recent commit (#17678) [red-knot] TypedDict: No errors for introspection dunder attributes (#17677) [`flake8-pyi`] Ensure `Literal[None,] | Literal[None,]` is not autofixed to `None | None` (`PYI061`) (#17659) [red-knot] No errors for definitions of `TypedDict`s (#17674) Update actions/download-artifact digest to d3f86a1 (#17664) [red-knot] Use 101 exit code when there's at least one diagnostic with severity 'fatal' (#17640) [`pycodestyle`] Fix duplicated diagnostic in `E712` (#17651) [airflow] fix typos `AIR312` (#17673) [red-knot] Don't ignore hidden files by default (#17655) Update pre-commit hook astral-sh/ruff-pre-commit to v0.11.7 (#17670) Update docker/build-push-action digest to 14487ce (#17665) Update taiki-e/install-action digest to ab3728c (#17666) ...
Summary
Removes ~850 diagnostics related to assignability of callable types, where the callable-being-assigned-to has a "Todo signature", which should probably accept any left hand side callable/signature.