@responses.activate triggers untyped decorator error in mypy
See original GitHub issueEnvironment
responses==0.17.0
mypy==0.931
Python 3.8.12
disallow_untyped_decorators = True
in mypy.ini
Steps to Reproduce
After upgrade to responses==0.17.0
, reran mypy
with settings unchanged from before.
Expected Result
mypy
passes as happened with responses==0.16.0
Actual Result
Every instance of @responses.activate
throws up:
error: Untyped decorator makes function "<function_name>" untyped [misc]
@responses.activate
The issue seems to be related to the change here where the type hint for activate
was changed from a callback protocol to Any
.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
mypy: Untyped decorator makes function "my_method" untyped
The mypy documentation contains the section describing the declaration of decorators for functions with an arbitrary signature.
Read more >Mypy Documentation - Read the Docs
Mypy is a static type checker for Python. Type checkers help ensure that you're using variables and functions in your code correctly.
Read more >mypy-django/Lobby - Gitter
I'm getting error: "Parent" has no attribute "children". Nikita Sobolev ... Request, *args: Any, **kwargs: Any) -> Response: # type: ignore[override].
Read more >2017 - The Mypy Blog
We've just uploaded mypy 0.560 to the Python Package Index (PyPI). This release includes new features, bug fixes and library stub (typeshed) ...
Read more >Understanding type annotation in Python - LogRocket Blog
It will focus on the mypy static type-checking tool and its operations in ... int x = 4; x = "hello"; // this...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It looks like that check has been disabled in this project’s mypy.ini. I can work on merging our stubs with the implementation and removing some of the disabled warnings.
@markstory any idea why
disallow_untyped_decorators
did not raise on our side?any test we can add to prevent this in the future?