KotlinIsland · GitHub

Feature

import warnings
from typing import NoReturn
def foo() -> NoReturn:
    warnings.warn("this is deprecated", DeprecationWarning)
    raise NotImplementedError
foo()  # I would expect a warning here

Pitch

I think it would be based to report against deprecated methods, PyCharm supports this:
image

Another use case for this is warning of "unsupported operations":

class A:
    def foo(self) -> None:
        print()
class B(A):
    def foo(self) -> NoReturn:
        warnings.warn("this is an unsupported operation", DeprecationWarning)
        raise NotImplementedError()
B().foo()  # I would like a warning that this is unsupported

Read the original on github.com ↗