Advertisement
Guest User

Untitled

a guest
Jul 16th, 2018
394
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.65 KB | None | 0 0
  1. #!/usr/local/bin/python3.7
  2. from typing import Dict
  3. foobar: Dict[str] = {"a": 1, "b": 2}
  4.  
  5.  
  6. result:
  7.  
  8. ~% ./test.py
  9. Traceback (most recent call last):
  10.   File "./test.py", line 3, in <module>
  11.     foobar: Dict[str] = {"a": 1, "b": 2}
  12.   File "/usr/local/lib/python3.7/typing.py", line 251, in inner
  13.     return func(*args, **kwds)
  14.   File "/usr/local/lib/python3.7/typing.py", line 627, in __getitem__
  15.     _check_generic(self, params)
  16.   File "/usr/local/lib/python3.7/typing.py", line 205, in _check_generic
  17.     raise TypeError(f"Too {'many' if alen > elen else 'few'} parameters for {cls};"
  18. TypeError: Too few parameters for typing.Dict; actual 1, expected 2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement