Describe the bug
Sphinx 4.1.2's test suite has 367 test failures and 13 errors with Python 3.10.0b4. They all seem to have a common cause in:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
obj = <class 'autodoc_target.Class'>
def isNewType(obj: Any) -> bool:
"""Check the if object is a kind of NewType."""
if sys.version_info >= (3, 10):
> return isinstance(obj, typing.NewType)
E TypeError: isinstance() arg 2 must be a type, a tuple of types or a union
obj = <class 'autodoc_target.Class'>
sphinx/util/inspect.py:215: TypeError
How to Reproduce
$ git clone https://github.com/sphinx-doc/sphinx
$ cd sphinx
$ tox -e py310
Expected behavior
No response
Your project
n/a
Screenshots
No response
OS
Gentoo Linux
Python version
3.10.0b4
Sphinx version
4.1.2 (+ git master)
Sphinx extensions
No response
Extra tools
No response
Additional context
Full superverbose build log (17M): dev-python:sphinx-4.1.2:20210727-064745.log