Skip to content
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

Typing improvements #104

Merged
merged 2 commits into from
Sep 9, 2022
Merged

Typing improvements #104

merged 2 commits into from
Sep 9, 2022

Conversation

jepler
Copy link
Member

@jepler jepler commented Sep 6, 2022

No description provided.

.. for compatibility, find_device can take a single device as well as a
sequence of devices. However, the static type info only permits the
sequence form.

This quiets the mypy diagnostic without adding any extra bytecode to
mpy files
.. and anyway the type is actually a Tuple when using usb_hid.devices
in CircuitPython.

This has a small cost in mpy file size but not as much as we earned back
with earlier optimizations. The over-broad exception is used in order
to reduce byte code growth
@jepler jepler requested a review from tekktrik September 6, 2022 15:45
Copy link
Member

@tekktrik tekktrik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Thanks for clarifying the disable!

@dhalbert dhalbert merged commit 93c7e0e into main Sep 9, 2022
@dhalbert dhalbert deleted the typing-improvements branch September 9, 2022 03:05
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Sep 9, 2022
Updating https://github.com/adafruit/Adafruit_CircuitPython_TFmini to 1.2.15 from 1.2.14:
  > Merge pull request adafruit/Adafruit_CircuitPython_TFmini#14 from tcfranks/main

Updating https://github.com/adafruit/Adafruit_CircuitPython_TLV493D to 2.0.0 from 1.2.13:
  > Merge pull request adafruit/Adafruit_CircuitPython_TLV493D#16 from BrianPugh/patch-1

Updating https://github.com/adafruit/Adafruit_CircuitPython_asyncio to 0.5.16 from 0.5.15:
  > Merge pull request adafruit/Adafruit_CircuitPython_asyncio#28 from tekktrik/dev/fix-ci
  > Merge pull request adafruit/Adafruit_CircuitPython_asyncio#26 from dedukun/main

Updating https://github.com/adafruit/Adafruit_CircuitPython_HID to 5.3.3 from 5.3.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_HID#104 from adafruit/typing-improvements
  > Merge pull request adafruit/Adafruit_CircuitPython_HID#103 from adafruit/dont-crash-on-full
  > Merge pull request adafruit/Adafruit_CircuitPython_HID#101 from adafruit/fix-import-python3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants