Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/local/bin/python3.7
- from typing import Dict
- foobar: Dict[str] = {"a": 1, "b": 2}
- result:
- ~% ./test.py
- Traceback (most recent call last):
- File "./test.py", line 3, in <module>
- foobar: Dict[str] = {"a": 1, "b": 2}
- File "/usr/local/lib/python3.7/typing.py", line 251, in inner
- return func(*args, **kwds)
- File "/usr/local/lib/python3.7/typing.py", line 627, in __getitem__
- _check_generic(self, params)
- File "/usr/local/lib/python3.7/typing.py", line 205, in _check_generic
- raise TypeError(f"Too {'many' if alen > elen else 'few'} parameters for {cls};"
- TypeError: Too few parameters for typing.Dict; actual 1, expected 2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement