Missing py.typed declaration?
See original GitHub issuemypy
is complaining about not being able to find type annotations for httpx
:
error: Cannot find module named 'httpx'
I’m somewhat new to using type annotations/static type checking in Python, but from the mypy documentation here it looks like there may be a missing declaration in setup.py
?
Issue Analytics
- State:
- Created 4 years ago
- Comments:21 (16 by maintainers)
Top Results From Across the Web
Running mypy and managing imports
Missing library stubs or py.typed marker# · To suppress a single missing import error, add a # type: ignore at the end of...
Read more >PEP 655 – Marking individual TypedDict items as required or ...
Having to declare two different TypedDict types for this purpose is cumbersome. This PEP introduces two new type qualifiers, typing.Required and typing.
Read more >Type Annotation in Python | Towards Data Science
Type annotations — also known as type signatures — are used to indicate the datatypes of variables and input/outputs of functions and methods....
Read more >Understanding type annotation in Python - LogRocket Blog
In this extensive post with specific examples, learn how to use Python type annotation to your advantage using the mypy library.
Read more >The Comprehensive Guide to mypy - Tushar's Blog
mypy --strict test.py test.py:1: error: Function is missing a ... BTW, since this function has no return statement, its return type is None ......
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
Related: It’s a bit of a gross hack that we need a
py.typed
file to indicate that we’re a well typed package. I don’t really dig it.Is there anything productive that we could do to push for a nicer alternative to become adopted in whichever of Python/MyPy/PyPI this is relevant too? (Eg. A top-level
__typed__ = True
variable in packages? A setting in PyPI package info?)Right on, thanks all!
@sethmlarson @florimondmanca This library is excellent btw