Skip to content

[3.10] bpo-44606: Fix __instancecheck__ and __subclasscheck__ for the union type. (GH-27120)#27132

Merged
miss-islington merged 1 commit intopython:3.10from
miss-islington:backport-8198905-3.10
Jul 14, 2021
Merged

[3.10] bpo-44606: Fix __instancecheck__ and __subclasscheck__ for the union type. (GH-27120)#27132
miss-islington merged 1 commit intopython:3.10from
miss-islington:backport-8198905-3.10

Conversation

@miss-islington
Copy link
Copy Markdown
Contributor

@miss-islington miss-islington commented Jul 14, 2021

  • Fix issubclass() for None.
    E.g. issubclass(type(None), int | None) returns now True.
  • Fix issubclass() for virtual subclasses.
    E.g. issubclass(dict, int | collections.abc.Mapping) returns now True.
  • Fix crash in isinstance() if the check for one of items raises exception.
    (cherry picked from commit 8198905)

Co-authored-by: Serhiy Storchaka [email protected]

https://bugs.python.org/issue44606

…type. (pythonGH-27120)

* Fix issubclass() for None.
  E.g. issubclass(type(None), int | None) returns now True.
* Fix issubclass() for virtual subclasses.
  E.g. issubclass(dict, int | collections.abc.Mapping) returns now True.
* Fix crash in isinstance() if the check for one of items raises exception.
(cherry picked from commit 8198905)

Co-authored-by: Serhiy Storchaka <[email protected]>
@miss-islington
Copy link
Copy Markdown
Contributor Author

@serhiy-storchaka: Status check is done, and it's a success ✅ .

@miss-islington
Copy link
Copy Markdown
Contributor Author

@serhiy-storchaka: Status check is done, and it's a success ✅ .

@miss-islington miss-islington merged commit b42eee7 into python:3.10 Jul 14, 2021
@miss-islington miss-islington deleted the backport-8198905-3.10 branch July 14, 2021 04:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants