Skip to content
Advertisement

PEP484 typing — how to annotate Callable with NoReturn type?

Is it possible to annotate Callable with the NoReturn type?

The way I would expect to do this yields an error:

JavaScript
JavaScript

Edit: for anyone who encounters this problem in the future, the issue was a bug in Python 3.7.0 and upgrading to Python 3.7.2 mitigates the issue.

Advertisement

Answer

For me (with Python 3.7.2) it works without an error:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement