[issue46611] Improve coverage of `__instancecheck__` and `__subclasscheck__` methods in `typing.py`

Nikita Sobolev report at bugs.python.org
Wed Feb 2 09:00:52 EST 2022


New submission from Nikita Sobolev <mail at sobolevn.me>:

There are several problem reported by coverage:
1. This line is never reached in `_SpecialGenericAlias.__subclasscheck__`: https://github.com/python/cpython/blob/08f8301b21648d58d053e1a513db8ed32fbf37dd/Lib/typing.py#L1140
2. `__instancecheck__` and `__subclasscheck__` for `_UnionGenericAlias` are not covered at all: https://github.com/python/cpython/blob/08f8301b21648d58d053e1a513db8ed32fbf37dd/Lib/typing.py#L1243-L1249 I suspect this happened because of `types.UnionType` / `typing.Union` duality

I am going to add these today! 

By the way, this is the last coverage issue in typing! 🎉

----------
components: Library (Lib)
messages: 412361
nosy: sobolevn
priority: normal
severity: normal
status: open
title: Improve coverage of `__instancecheck__` and `__subclasscheck__` methods in `typing.py`
type: behavior
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46611>
_______________________________________


More information about the Python-bugs-list mailing list