Conversation
1ca8b79 to
bebf2b5
Compare
|
extra stuff found by mypy (mostly untyped defs): |
6800f9d to
a1d1130
Compare
5912594 to
6af971f
Compare
| no_implicit_optional = false | ||
| exclude = ["python/tests/"] | ||
|
|
||
| [tool.pyright] |
There was a problem hiding this comment.
Should we pick one of pyright or mypy and drop the other?
There was a problem hiding this comment.
would agree, would kinda lean towards sticking to mypy rather than making changes. pylsp-mypy exists though I assume it's slower
There was a problem hiding this comment.
As a long-time mypy user, I like pyright more:
- can check untyped defs
- these things: https://github.com/microsoft/pyright/blob/main/docs/mypy-comparison.md
- has way more options to warn/error on things we weren't checking for
Notably pyright actually passes the pydantic stuff :)
There was a problem hiding this comment.
...I've had check-untyped-defs on the entire time I've used mypy. but I have to agree that this is fairly compelling even if the javascript stuff is weird.
| class PredictionRequest(schema.PredictionRequest.with_types(input_type=InputType)): | ||
| pass |
There was a problem hiding this comment.
tldr this allows typingchecking PredictionRequest usage by pyright (still not mypy, though)
721d32f to
a2971ec
Compare
Signed-off-by: Yorick van Pelt <yorick@yorickvanpelt.nl>
Signed-off-by: Yorick van Pelt <yorick@yorickvanpelt.nl>
Signed-off-by: Yorick van Pelt <yorick@yorickvanpelt.nl>
Signed-off-by: Yorick van Pelt <yorick@yorickvanpelt.nl>
Signed-off-by: Yorick van Pelt <yorick@yorickvanpelt.nl>
Signed-off-by: Yorick van Pelt <yorick@yorickvanpelt.nl>
Signed-off-by: Yorick van Pelt <yorick@yorickvanpelt.nl>
Signed-off-by: Yorick van Pelt <yorick@yorickvanpelt.nl>
Signed-off-by: Yorick van Pelt <yorick@yorickvanpelt.nl>
Signed-off-by: Yorick van Pelt <yorick@yorickvanpelt.nl>
Signed-off-by: Yorick van Pelt <yorick@yorickvanpelt.nl>
Signed-off-by: Yorick van Pelt <yorick@yorickvanpelt.nl>
Signed-off-by: Yorick van Pelt <yorick@yorickvanpelt.nl>
Signed-off-by: Yorick van Pelt <yorick@yorickvanpelt.nl>
Signed-off-by: Yorick van Pelt <yorick@yorickvanpelt.nl>
Signed-off-by: Yorick van Pelt <yorick@yorickvanpelt.nl>
Signed-off-by: Yorick van Pelt <yorick@yorickvanpelt.nl>
a2971ec to
2c8a65c
Compare
|
Love it! I'd like to request that if we go all in on |
nickstenning
left a comment
There was a problem hiding this comment.
Modulo failing tests (I think we'll have to use "old" ways of defining union types for a while to support <3.10) this seems great, particularly the bit where we typecheck in CI!
technillogue
left a comment
There was a problem hiding this comment.
this PR probably shouldn't change async functionality
Signed-off-by: Yorick van Pelt <yorick@yorickvanpelt.nl>
Signed-off-by: Yorick van Pelt <yorick@yorickvanpelt.nl>
Signed-off-by: Yorick van Pelt <yorick@yorickvanpelt.nl>
Signed-off-by: Yorick van Pelt <yorick@yorickvanpelt.nl>
982b2b8 to
9aca73b
Compare
Signed-off-by: Yorick van Pelt <yorick@yorickvanpelt.nl>
I fell into a typing hole while setting up pyright-lsp. Nevertheless, I think these are good changes, mostly preventing some annoying crashes (ast_openapi_scha + bytes defaults, cpus being uncountable).
Fixes #1360