Skip to content

Conversation

@dhalbert
Copy link
Contributor

circuitpython/shared-bindings/circuitpython_typing defined some types for annotation. Move those to here. This is a prelude to further changes for adafruit/circuitpython#6085.

In this code, some types are defined directly, and some are defined with string names, in case they are not available to import. Mypy does only limited run-time evaluations, so it's not possible to define types conditionally with guarded imports and have that work in mypy.

Also, a py.typed file was added, so that the .py files here can be used by mypy, per PEP 561.

Copy link
Contributor

@FoamyGuy FoamyGuy 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 @dhalbert

@dhalbert dhalbert merged commit 26dfc45 into adafruit:main Mar 1, 2022
@dhalbert dhalbert deleted the shared-bindings-defs branch March 1, 2022 01:19
@dhalbert
Copy link
Contributor Author

dhalbert commented Mar 1, 2022

Tested on RPi buster with blinka.

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.

2 participants