JelleZijlstra / autotyping

Automatically add simple type annotations to your code
215 stars 18 forks source link

Detecting whether a function has implicit `None` returns #62

Closed tusharsadhwani closed 4 months ago

tusharsadhwani commented 1 year ago

Basic control flow can be implemented to remove all false positive cases where implicit None return may happen.

The strategy

If it sounds good, I can try and implement exactly this.

JelleZijlstra commented 1 year ago

I'm not enthusiastic about this because I want autotyping to remain a simple tool, not a type inference engine. I already help maintain two type checkers (pyanalyze and mypy) and that's plenty. Specifically the "or something like exit() or sys.exit()" information: doing that right requires us to look in typeshed or annotations to figure out which functions return Never.