-
Notifications
You must be signed in to change notification settings - Fork 32
python: replace mypy by ty #235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
fselmo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tcoratger I added a cleanup commit and a nit commit directly after that replaces cast(Any, ...) logic with more explicit ignores and / or class definitions. These were only in the tests so I don't mind either way tbh. If you feel casting to Any is better or easier to read, feel free to drop that commit.
I noticed that the mypy pydantic plugin does a lot to help the code understand the type coercion that pydantic does. ty doesn't seem to have this and I'm not sure they ever plan on having it tbh. Things like Boolean(True), Boolean(False), etc instead of being able to use True, False and have pydantic convert to Boolean internally.
I'm not sure that this is necessarily a bad thing, it just makes things more verbose. For specifications, this seems totally reasonable so either way I am good with it - just making an observation here π.
It's amazing how fast ty is π... this lgtm ππΌ
Thanks a lot for the review. For me, the fact that Thanks for the commits, it looks very good now, I'll merge it now, that is much much faster than mypy :) |
* python: replace mypy by ty * fmt * fix strange ignore * bitfield fix * element property method simplification * rm useless ty rule * bump ty * fix conflicts * small simplifications * remove useless thing * minor cleanup related to adding ty * refactor: avoid cast(Any, ...), be more explicit with test models + ignores --------- Co-authored-by: fselmo <[email protected]>
ποΈ Description
π Related Issues or PRs
Should close #60
β Checklist
toxchecks to avoid unnecessary CI fails:uvx tox