fromtypingimportTypeGuardclassA:
def__call__(self, a) ->TypeGuard[int]:
returnTruea: Aasserta(a=1)
> mypy test.py --tbtest.py:7: error: INTERNAL ERROR -- Please try using mypy master on GitHub:https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-buildPlease report a bug at https://github.com/python/mypy/issuesversion: 1.5.1Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "mypy\checker.py", line 584, in accept # least one type that we don't know. File "mypy\nodes.py", line 1435, in accept File "mypy\checker.py", line 4409, in visit_assert_stmt return # The partial type is None. File "mypy\checker.py", line 5455, in find_isinstance_check return [typ], [] File "mypy\checker.py", line 5501, in find_isinstance_check_helper """AssertionError:test.py:7: : note: use --pdb to drop into pdb
Activity
Fix crash on TypeGuard in __call__ (#16516)