python / typing-council

Decisions by the Python Typing Council
41 stars 3 forks source link

Allow `NoReturn` to appear outside of function return type annotations #5

Closed erictraut closed 7 months ago

erictraut commented 7 months ago

I would like request that the typing council consider amending the typing spec to allow NoReturn to appear in locations other than return type annotations. It is equivalent to Never, and the two types should be completely interchangeable.

This was discussed in the python/typing forum, and there were no objections to the change.

All four major type checkers already treat NoReturn in the manner consistent with the proposed change, so this would bring the spec in conformance with the type checker implementations.

I've prepared this PR with the proposed change to the typing spec.

gvanrossum commented 7 months ago

+1.

Do we have a process for this kind of thing yet? Do we all just approve the PR and then you merge it?

JelleZijlstra commented 7 months ago

Also agree. I think for this sort of small, relatively uncontroversial change it's OK to just approve on GitHub. We can have a bigger discussion on Discord for anything more controversial.

JelleZijlstra commented 7 months ago

Everyone on the Council approved the PR; this proposal has been accepted.