-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[Python] Improve type hints of cluster objects #29966
[Python] Improve type hints of cluster objects #29966
Conversation
This is currently WIP. There are still errors reported related to enums. Ideas welcome:
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
41f9d33
to
a541320
Compare
PR #29966: Size comparison from fab01d8 to a541320 Full report (85 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, mbed, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
a541320
to
e24af87
Compare
PR #29966: Size comparison from 2af3379 to e24af87 Full report (85 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, mbed, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
e24af87
to
e69177b
Compare
PR #29966: Size comparison from 04e21d9 to e69177b Full report (16 builds for nrfconnect, nxp, qpg, stm32, tizen)
|
e69177b
to
9f03ab8
Compare
PR #29966: Size comparison from 04e21d9 to 9f03ab8 Full report (82 builds for bl602, bl702, bl702l, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
a9ce5e5
to
48c98e3
Compare
PR #29966: Size comparison from 1dacd5d to 48c98e3 Full report (16 builds for nrfconnect, nxp, qpg, stm32, tizen)
|
48c98e3
to
ac1e5a1
Compare
PR #29966: Size comparison from 1dacd5d to ac1e5a1 Full report (82 builds for bl602, bl702, bl702l, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
Very old PR with merge conflicts and a comment of "this is still WIP". Assuming stale and closing. |
Well, I actually rebased somewhat recently, and hoped to get it in soon, but was lacking reviews and then it got merge conflicts again 🙈 . I'll rebase again and ping some folks for review. |
Re-opening as active. @agners please help with mergging to master and this close and re-open hopefully pushes us to move this higher up the priority list. |
The default value returns a valid value for the initialization according to the type hints. This lowers the type hints errors using mypy from 838 to 354.
This reduced mypy type errors from 354 to 163.
Python 3.7 and newer don't need strings for type annotations anymore. This makes type annotations more readable in most editors.
c5560d5
to
0ce5504
Compare
0ce5504
to
7b64268
Compare
I've rebased to master, should be ready for review/merging now. |
PR #29966: Size comparison from 579b1b1 to 7b64268 Full report (17 builds for cc13x4_26x4, cc32xx, nxp, qpg, stm32, tizen)
|
7b64268
to
b437bac
Compare
PR #29966: Size comparison from 579b1b1 to b437bac Full report (82 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
* Use default value for initialization The default value returns a valid value for the initialization according to the type hints. This lowers the type hints errors using mypy from 838 to 354. * Make response_type an optional string if initialized to None This reduced mypy type errors from 354 to 163. * Use non-string type annotations Python 3.7 and newer don't need strings for type annotations anymore. This makes type annotations more readable in most editors. * regen
Using
mypy
to check type hints reports errors on the automatically generated Cluster objects. This PR addresses some of the errors.mypy
can be run using the following command: