Incomplete type for log_config
parameter to uvicorn.run()
in 0.18.1
#1536
-
The type for the log_config: typing.Optional[typing.Union[dict, str]] = None, Line 481 in 11d28e2 I believe it should be log_config: typing.Optional[typing.Union[typing.Dict[str, typing.Any], str]] = None, mypy seems to be OK with the existing code, but pyright flags the current code as an error, with the following message:
For a simple test of how mypy and pyright handle a bare
It's possible that mypy is just less strict, but in any case, a stricter type would be helpful. The same thing goes for the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Sure. PR welcome to use a more explicit type annotation. Not sure if it was a suggestion, but I think that changing the type checker is out of question. 😅 |
Beta Was this translation helpful? Give feedback.
-
Ha, no, I wasn't suggesting changing the type checker. It's just that I use pyright on my code which calls |
Beta Was this translation helpful? Give feedback.
Sure. PR welcome to use a more explicit type annotation.
Not sure if it was a suggestion, but I think that changing the type checker is out of question. 😅