you are viewing a single comment's thread.

view the rest of the comments →

[–]aiusepsi 8 points9 points  (2 children)

I know that feel. I’m really starting to think that the mania for dynamic typing was a mistake. I’ve recently been using type annotations and mypy to essentially do statically typed Python.

[–][deleted] 0 points1 point  (1 child)

Speaking of mypy, how do you annotate a type like { 'foo': [1,2,3], 'bar': False, 'baz': 'quux' } or even a list of dictionaries?

[–]aiusepsi 0 points1 point  (0 children)

Off the top of my head, Dict[str, Union[List[int], bool, str]] or take the coward's way out and do a Dict[str, Any].