ruff
92028efe - [red-knot] Fix disambiguate display for union types (#16907)

Commit
198 days ago
[red-knot] Fix disambiguate display for union types (#16907) <!-- 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>
Author
Parents
Loading