From 163ccedb39ed62aa9a0c5bfc217a9e88f62add75 Mon Sep 17 00:00:00 2001 From: Martin Milata Date: Tue, 8 Sep 2020 14:29:05 +0200 Subject: [PATCH] core: allow const() values to have Literal type --- core/mocks/micropython.pyi | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/mocks/micropython.pyi b/core/mocks/micropython.pyi index eaf75a7f3..661204442 100644 --- a/core/mocks/micropython.pyi +++ b/core/mocks/micropython.pyi @@ -1,4 +1,8 @@ -def const(c: int) -> int: ... +from typing import TypeVar + +C = TypeVar("C", bound=int) + +def const(c: C) -> C: ... def mem_info() -> None: ... def mem_current() -> int: ... def mem_total() -> int: ...