Skip to content

Document additional static type checking without a typing module #766

@Josverl

Description

@Josverl

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

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentation

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions