diff --git a/python-stdlib/typing/__init__.py b/python-stdlib/typing/__init__.py new file mode 100644 index 000000000..12b090811 --- /dev/null +++ b/python-stdlib/typing/__init__.py @@ -0,0 +1,19 @@ +# Typing module ported to MicroPython + +# For official documentation, see https://github.com/python/cpython/blob/main/Lib/typing.py + +class Any: + """typing.Any""" + + def __init_subclass__(cls, **kwargs): + if not "_root" in kwargs: + raise TypeError("Any is not subclassable") + +class Callable(Any, root): + """typing.Callable""" + +class Generic: + + def __class_getitem__(cls, items): ... + def __init_subclass__(cls, **kwargs): ... + def __new__(cls, *args, **kwargs): ...