Skip to content

Commit d92dc80

Browse files
committed
Make micropython.const accept any constant type
micropython.const now supports any constant type, not just int. This updates the type checking to reflect this. This also updates the name of the file so that type checkers can find it.
1 parent a2ce100 commit d92dc80

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/micropython-stubs/micropython.pyi renamed to src/micropython-stubs/__init__.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ from typing import Callable, TypeVar, Any, NoReturn
1212

1313
Fun = TypeVar("Fun", bound=Callable[..., Any])
1414

15-
def const(x: int) -> int:
15+
def const[T](x: T) -> T:
1616
"Emulate making a constant"
1717

1818
def native(f: Fun) -> Fun:

0 commit comments

Comments
 (0)