Type hint for a dict gives TypeError: 'type' object is not subscriptable

If you're using python 3.8, then perhaps you need to do some import from typing import Dict memo: Dict[int, int] = {0: 0, 1: 1} If you're using python 3.9 and above, you should be good. If you're going to do some type hinting. memo: dict[int, int] = {0: 0, 1: 1}

Comments

Popular posts from this blog

gemini cli getting file not defined error

NodeJS: Error: spawn EINVAL in window for node version 20.20 and 18.20

vllm : Failed to infer device type