Skip to content

Conversation

@Fidget-Spinner
Copy link
Member

@Fidget-Spinner Fidget-Spinner commented Jan 2, 2021

Previously this didn't raise an error. Now it will:

from collections.abc import Callable
isinstance(int, list | Callable[..., str])

Also added tests in Union since there were previously none for stuff like isinstance(list, list | list[int]) either.

Backport to 3.9 not required.

https://bugs.python.org/issue42195

Automerge-Triggered-By: GH:gvanrossum

@Fidget-Spinner
Copy link
Member Author

I think we can skip news, the code was valid up till before PR-23060 so it can share the same news as that one.

@miss-islington miss-islington merged commit 49cd68f into python:master Jan 2, 2021
@Fidget-Spinner Fidget-Spinner deleted the union-block-callable branch January 2, 2021 16:26
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 13, 2021
…iases in Union (pythonGH-24059)

Previously this didn't raise an error. Now it will:
```python
from collections.abc import Callable
isinstance(int, list | Callable[..., str])
```
Also added tests in Union since there were previously none for stuff like ``isinstance(list, list | list[int])`` either.

Backport to 3.9 not required.

Automerge-Triggered-By: GH:gvanrossum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants