File tree Expand file tree Collapse file tree
micropython/bundles/bundle-typing Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # type: ignore[all]
2+ # Bundle to simplify including typing support in MicroPython projects.
3+ # This is not a full implementation of the typing module, but balances
4+ # functionality with code size, while ignoring type hints at runtime
5+ # to save resources.
6+ # Usage:
7+ # require("bundle-typing")
8+ # require("bundle-typing", extensions=True)
9+
10+ metadata (
11+ version = "1.0.0" ,
12+ description = "Limited runtime typing support for MicroPython." ,
13+ )
14+
15+ options .defaults (opt_level = 3 , extensions = False )
16+
17+ # Primary typing related modules
18+ require ("__future__" , opt_level = options .opt_level )
19+ require ("typing" , opt_level = options .opt_level )
20+ require ("typing_extensions" , opt_level = options .opt_level )
21+
22+ # Optional typing modules
23+ if options .extensions :
24+ require ("collections" , opt_level = options .opt_level )
25+ require ("collections-abc" , opt_level = options .opt_level )
26+ require ("abc" , opt_level = options .opt_level )
You can’t perform that action at this time.
0 commit comments