The Python Oracle

Using List/Tuple/etc. from typing vs directly referring type as list/tuple/etc

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: Puddle Jumping Looping

--

Chapters
00:00 Question
00:38 Accepted answer (Score 260)
02:35 Answer 2 (Score 135)
04:14 Thank you

--

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

Accepted answer links:
[added support for type hinting using standard collections]: https://docs.python.org/3/whatsnew/3.9.h...
[used as ]: https://docs.python.org/3/library/typing...
[typing.Tuple]: https://docs.python.org/3/library/typing...
[typing.List]: https://docs.python.org/3/library/typing...
[typing.Sequence]: https://docs.python.org/3/library/typing...
[implement a ]: https://docs.python.org/3/reference/data...
[typing.Generic]: https://docs.python.org/3/library/typing...

Answer 2 links:
[PEP 585]: https://www.python.org/dev/peps/pep-0585/
[PEP 563]: https://www.python.org/dev/peps/pep-0563/
[other generics]: https://www.python.org/dev/peps/pep-0585...
[PEP 563]: https://www.python.org/dev/peps/pep-0563/

--

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

--

Tags
#python #typehinting #pythontyping

#avk47