mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-03 10:23:11 +00:00
![]() <!-- Thank you for contributing to Ruff! To help us out with reviewing, please consider the following: - Does this pull request include a summary of the change? (See below.) - Does this pull request include a descriptive title? - Does this pull request include references to any relevant issues? --> ## Summary When callables are displayed in unions, like: ```py from typing import Callable def foo(x: Callable[[], int] | None): # red-knot: Revealed type is `() -> int | None` [revealed-type] reveal_type(x) ``` This leaves the type rather ambiguous, to fix this we can add parenthesis to callable type in union Fixes #16893 ## Test Plan Update callable annotations tests --------- Co-authored-by: Micha Reiser <micha@reiser.io> |
||
---|---|---|
.. | ||
resources | ||
src | ||
tests | ||
build.rs | ||
Cargo.toml | ||
mdtest.py | ||
mdtest.py.lock |