Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix handling of NoReturn in Union return types (#11996)
There are several discussions and comments describing the following problem (references can be found at the end of the PR summary): ```python def func() -> str | NoReturn: ... func().lower() ``` At the moment the code results in: `"NoReturn" of "Union[str, NoReturn]" has no attribute "lower"` Make `Union[int, NoReturn]` equivalent to `int` in a return type, because in case the function returns it must be `int`.
- Loading branch information