python / typing-council

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

`@no_type_check` decorator #16

Closed erictraut closed 6 months ago

erictraut commented 6 months ago

I would like to request that the TC consider the adoption of a proposed change to the typing spec regarding the @no_type_check decorator.

TC Sign-off

Links to PR & Discussions The draft PR can be found here. It incorporates feedback from PR reviews and discussion.

The discussion can be found here.

Impact to type checkers Pyright, pyre and pytype already conform with the proposed specification.

Mypy mostly conforms to the proposed spec but would require a small change. It currently changes the signature of a function decorated with @no_type_check to Callable[..., Any] rather than simply treating the function signature as though it's unannotated.

gvanrossum commented 6 months ago

I added a comment to the discussion pleading for a fuller specification for classes. But since three people already signed off on Eric's proposal, and I don't have that much appetite for a prolonged discussion, I'll check the box here.

erictraut commented 6 months ago

@hauntsaninja, let me know if you have any other suggestions or concerns. If not, please sign off.

hauntsaninja commented 6 months ago

Thanks for pushing this discussion forward. The new words in the spec are strictly better than the status quo.

re no_type_check for classes: This felt like an interesting place for us to end up, but given that in a decade no type checker and only a handful of users have bothered with it, I'm happy to move on.