-
Notifications
You must be signed in to change notification settings - Fork 48
Open
python/mypy
#20044Labels
crashFailing compile-time asserts, unhandled exceptions, or generated C code that's blowing up.Failing compile-time asserts, unhandled exceptions, or generated C code that's blowing up.priority-0-high
Description
This was reported by @Chainfire at python/mypy#19376 (comment).
This raises TypeError
(see the above link for the traceback):
from typing import Type
import asyncio
import traceback
class Parent:
async def test(self) -> int:
raise NotImplementedError()
async def run(self) -> int:
return await self.test()
class ChildTypeError1(Parent):
async def test(self) -> int:
return 1
class ChildTypeError2(Parent):
async def run(self) -> int:
return await self.test()
def test(cls: Type[Parent]) -> None:
print(str(cls.__name__))
try:
print("- ", asyncio.run(cls().run()))
except NotImplementedError:
pass
except Exception:
traceback.print_exc()
exit(1)
test(ChildTypeError1)
test(ChildTypeError2)
exit(0)
This is a regression introduced in python/mypy#19376 by me.
Metadata
Metadata
Assignees
Labels
crashFailing compile-time asserts, unhandled exceptions, or generated C code that's blowing up.Failing compile-time asserts, unhandled exceptions, or generated C code that's blowing up.priority-0-high