-
Notifications
You must be signed in to change notification settings - Fork 81
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
enforced typing on all APIs? #160
Comments
yes please, go ahead! |
DanAlbert
added a commit
to DanAlbert/dcs
that referenced
this issue
Jul 9, 2021
Part of pydcs#160. In many cases this is being solved with assert/raise to inform mypy of the "guaranteed" types. They could be removed later with some changes to the implementation/API, but those will be easier to make once the type checker is fully on. There are a small number of API changes here, primarily removing default kwargs that aren't actually defaultable (using the defaults would result in a crash).
DanAlbert
added a commit
to DanAlbert/dcs
that referenced
this issue
Jul 9, 2021
#161 addresses the first two todo items. |
DanAlbert
added a commit
to DanAlbert/dcs
that referenced
this issue
Jul 9, 2021
Part of pydcs#160. In many cases this is being solved with assert/raise to inform mypy of the "guaranteed" types. They could be removed later with some changes to the implementation/API, but those will be easier to make once the type checker is fully on. There are a small number of API changes here, primarily removing default kwargs that aren't actually defaultable (using the defaults would result in a crash).
DanAlbert
added a commit
to DanAlbert/dcs
that referenced
this issue
Jul 9, 2021
DanAlbert
added a commit
to DanAlbert/dcs
that referenced
this issue
Jul 9, 2021
DanAlbert
added a commit
to DanAlbert/dcs
that referenced
this issue
Jul 9, 2021
Part of pydcs#160. In many cases this is being solved with assert/raise to inform mypy of the "guaranteed" types. They could be removed later with some changes to the implementation/API, but those will be easier to make once the type checker is fully on. There are a small number of API changes here, primarily removing default kwargs that aren't actually defaultable (using the defaults would result in a crash).
DanAlbert
added a commit
to DanAlbert/dcs
that referenced
this issue
Jul 9, 2021
DanAlbert
added a commit
to DanAlbert/dcs
that referenced
this issue
Jul 9, 2021
Part of pydcs#160. In many cases this is being solved with assert/raise to inform mypy of the "guaranteed" types. They could be removed later with some changes to the implementation/API, but those will be easier to make once the type checker is fully on. There are a small number of API changes here, primarily removing default kwargs that aren't actually defaultable (using the defaults would result in a crash).
DanAlbert
added a commit
to DanAlbert/dcs
that referenced
this issue
Jul 9, 2021
rp-
pushed a commit
that referenced
this issue
Jul 9, 2021
Part of #160. In many cases this is being solved with assert/raise to inform mypy of the "guaranteed" types. They could be removed later with some changes to the implementation/API, but those will be easier to make once the type checker is fully on. There are a small number of API changes here, primarily removing default kwargs that aren't actually defaultable (using the defaults would result in a crash).
rp-
pushed a commit
that referenced
this issue
Jul 9, 2021
DanAlbert
added a commit
to DanAlbert/dcs
that referenced
this issue
Jul 9, 2021
rp-
pushed a commit
that referenced
this issue
Jul 11, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I can do the work here if that's preferred (and I assume it is), but I wanted to make sure that the patch would be welcome first, since it'd take a sizable time commitment to create.
We (DCS Liberation) hit a not small number of bugs where we have type mismatches between our code and pydcs. mypy does its best for libraries without complete type info, but it's pretty common for anything imported that isn't sufficiently typed to end up degrading to
Any
, at which point mypy does nothing.What I'd like to do is send a (probably quite large, but also should be quite straightforward) PR that adds any missing type annotations and enforces
disallow_untyped_defs = True
in mypy.ini, and make sure that runs as part of the github actions.Any objections? Type annotations can take a bit of work to maintain, but IME it's quite small, especially when compared to the number of bugs they catch.
Todo items:
The text was updated successfully, but these errors were encountered: