The Python Oracle

Difference between defining typing.Dict and dict?

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: The Builders

--

Chapters
00:00 Question
01:02 Accepted answer (Score 300)
03:04 Answer 2 (Score 39)
03:34 Answer 3 (Score 12)
04:24 Answer 4 (Score 2)
04:49 Thank you

--

Full question
https://stackoverflow.com/questions/3708...

Question links:
[typing]: https://docs.python.org/3/library/typing...

Accepted answer links:
[Generic type]: https://docs.python.org/3/library/typing...
[Mapping]: https://docs.python.org/3/library/typing...
[MutableMapping]: https://docs.python.org/3/library/typing...
[from __future__ import annotations]: https://www.python.org/dev/peps/pep-0563/
[supports being used as generic type even without that directive]: https://www.python.org/dev/peps/pep-0585/

Answer 2 links:
[typing.Dict]: https://docs.python.org/3/library/typing...

Answer 3 links:
[python org]: https://docs.python.org/3/library/typing...
[PEP 585]: https://www.python.org/dev/peps/pep-0585...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #dictionary #typehinting #pythontyping

#avk47