-
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
fixing type hints errors on python controller code #34415
Conversation
PR #34415: Size comparison from d62f5a6 to 34f3009 Full report (8 builds for cc32xx, mbed, qpg, stm32, tizen)
|
34f3009
to
16abf43
Compare
PR #34415: Size comparison from d62f5a6 to 16abf43 Full report (11 builds for cc32xx, mbed, nrfconnect, qpg, stm32, tizen)
|
16abf43
to
1ac1e79
Compare
PR #34415: Size comparison from d62f5a6 to f28ddb5 Full report (20 builds for cc13x4_26x4, cc32xx, mbed, nrfconnect, nxp, qpg, stm32, tizen)
|
0576e59
to
12bb98e
Compare
1e9b929
to
23ace52
Compare
bc402af
to
89613a7
Compare
PR #34415: Size comparison from f6022e4 to 2b1dd69 Full report (82 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, esp32, linux, mbed, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
2eb5639
to
7c0d57d
Compare
PR #34415: Size comparison from 63959ca to 7c0d57d Full report (85 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, mbed, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
9f579e2
to
aa72c01
Compare
PR #34415: Size comparison from 10b67ad to aa72c01 Full report (82 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, mbed, nxp, psoc6, qpg, stm32, telink, tizen)
|
Yes, please let's update mypy. It is safe to use a newer version, even the latest version supports older Python versions (down to Python 3.7 it seems). So updating mypy can only improve checking 👍
Does that mean we can get rid of the subscriptable pointer type work around? If so, I definitly go for mypy upgrade in this PR, and drop the work around. If we still need the work around, we can update mypy in a separate PR. |
|
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.
In general, fixing/improving type hints is very welcome, so thank you for the PR 🙏
It is a bit hard to review currently due to the additional wrapping. Can you reformat again with line-lenght set to 132?
One thing I'd like to consider is bumping the minimal Python version at one point. It really gets interesting with Python 3.10 PEP 604, but maybe it is a bit early for that.
aa72c01
to
06268b5
Compare
06268b5
to
8945625
Compare
36298b7
to
55d9b9c
Compare
PR #34415: Size comparison from 48be002 to 55d9b9c Full report (85 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, mbed, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
* fixing mypy errors * restyled * add new files to BUILD.gn * mypy: fixing p256keypair.py * more mypy fixes * adding workaround to allow type hinting ctypes pointers * more mypy fixes * more mypy fixes * Restyled by autopep8 --------- Co-authored-by: Restyled.io <commits@restyled.io>
in preparation of releasing chip python modules on PyPi,
mypy
is being run on the code to ensure compliance with type hint and annotation standards (such as PEP 484)UPDATE (Changes included):
await
inChipDeviceCtrl.py:221
property
fromChipDeviceControllerBase
__init__
of dataclass EventHeader__init__
of dataclass TypedAttributePath to__post_init__