diff --git a/python/builtins.py b/python/builtins.py index 8b6132fe..75e420a4 100644 --- a/python/builtins.py +++ b/python/builtins.py @@ -222,6 +222,7 @@ tuple.__ge__ = __f list.__ge__ = __f type.__repr__ = lambda self: "" +type.__getitem__ = lambda self, T: self # for generics def help(obj): if hasattr(obj, '__func__'): diff --git a/python/typing.py b/python/typing.py index f553b032..bfc77b6e 100644 --- a/python/typing.py +++ b/python/typing.py @@ -20,4 +20,8 @@ Callable = _PLACEHOLDER Type = _PLACEHOLDER TypeVar = _PLACEHOLDER -Self = _PLACEHOLDER \ No newline at end of file +Self = _PLACEHOLDER + +class Generic: + def __getitem__(self, T): + return object \ No newline at end of file