From 9c5945a8884f6859fbf84dda4f91cf39a144b194 Mon Sep 17 00:00:00 2001 From: matejcik Date: Thu, 18 Nov 2021 12:31:07 +0100 Subject: [PATCH] chore(core): add fake typing module (not included in build) --- core/src/typing.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 core/src/typing.py diff --git a/core/src/typing.py b/core/src/typing.py new file mode 100644 index 000000000..0fc0c65fd --- /dev/null +++ b/core/src/typing.py @@ -0,0 +1,18 @@ +TYPE_CHECKING = False + +class _GenericTypingObject: + def __init__(self, *args, **kwargs): + pass + + def __getattr__(self, key): + # property access: P.kwargs + return object + + def __getitem__(self, key): + # dict-like access: Generic[T], Generic[K, V] + return self + +_TYPING_OBJECT = _GenericTypingObject() + +def __getattr__(key): + return _TYPING_OBJECT