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

Document additional static type checking without a typing module #766

Open
Josverl opened this issue Nov 1, 2024 · 0 comments
Open

Document additional static type checking without a typing module #766

Josverl opened this issue Nov 1, 2024 · 0 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@Josverl
Copy link
Owner

Josverl commented Nov 1, 2024

Document additional manner of static type checking without a typing module.

from machine import I2C

TYPE_CHECKING = False
if TYPE_CHECKING:
    from enum import IntEnum
    from typing import Optional
else:
    IntEnum = object
    Optional = object

ref: https://github.com/eosti/micropython-aw210xx/blob/main/src/aw210xx.py

@Josverl Josverl added the documentation Improvements or additions to documentation label Nov 1, 2024
@Josverl Josverl self-assigned this Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant