]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-44606: Fix __instancecheck__ and __subclasscheck__ for the union type. (GH-27120)
authorSerhiy Storchaka <storchaka@gmail.com>
Wed, 14 Jul 2021 04:35:39 +0000 (07:35 +0300)
committerGitHub <noreply@github.com>
Wed, 14 Jul 2021 04:35:39 +0000 (07:35 +0300)
commit81989058de381108dfd0a4255b93d4fb34417002
treeed13e2a5964c4efb0fe450b6af8db5ad2e2233ff
parent0093876328afa330224c9d887c18dee0b3117852
bpo-44606: Fix __instancecheck__ and __subclasscheck__ for the union type. (GH-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.
Lib/test/test_types.py
Misc/NEWS.d/next/Core and Builtins/2021-07-13-20-22-12.bpo-44606.S3Bv2w.rst [new file with mode: 0644]
Objects/unionobject.c