Closed tompollard closed 1 year ago
Awesome to see you working on this!
Would highly recommend support pyright
in addition/instead, for reasons listed here: https://github.com/microsoft/pyright/blob/main/docs/mypy-comparison.md
Moreover, pyright ships with VSCode
and can be enabled in the editor by setting type check
to basic
.
Thanks Martin, I'll take a look!
Sure thing!
If tableone
is partially typed, pyright
will definitely lead to a more robust package since it infers types – mypy
will only find mistakes if you have two type hints that conflict.
Feel free to ping me if you want help, we've recently migrated a few codebases to pyright
.
Thanks @MartinBernstorff, I would definitely appreciate your help in understanding how best to implement this. Any chance we could find a time for a 30min chat? I'll drop you an email!
I've added pyright to the workflow in the following PR: https://github.com/tompollard/tableone/actions/runs/4852818564/jobs/8648281298.
Plan is to fix the issues in a separate branch, so the PR can eventually be merged.
We are now running type testing with pyright in the github workflow. Many of the errors are currently being ignored, so I have raised a new issue to remind us to address this: https://github.com/tompollard/tableone/issues/155
mypy is a type checker. It can be installed with:
...and then run with:
mypy reports the following issues:
Fix these issues!