How to use python type hinting?

preview_player
Показать описание
In this video, I will show you how to use type hints by example. We are going to put hinting to work, by actually adding type hints to some code I have prepared for us. We will learn the basics of Python's type system as well as some more advanced topics like Union and Generics.

CODE:

---

This video contains advertising content.

#python #programming
Рекомендации по теме
Комментарии
Автор

Great tutorial, needed a quick refresher!

NicholasRenotte
Автор

Thank you! For me this it way more accessible and digestible than the documentation.

ryman
Автор

now that is how you explain 100s of videos on youtube couldnt pull this one off, well done chief!

Saitama-urlq
Автор

9:20 this is basically like C++ templates...
I like the way you edit your videos, nice production value.

greob
Автор

wow, what a coincidence I was looking to use type hinting inside my Binary search tree and I found this video. This is exactly what I was looking for.

pkavenger
Автор

Great Stuff. Concise, clear and with proper explanation. And yes you covered a lot in 18 minutes 👌🏼👍🏼

AakashNarang
Автор

Thank you so much for this video.

I was looking for what looked like a eternity on how to solve the forward referencing (I now know what to call it :))

Hands down the most useful python video I have seen in a while

DuarteMolha
Автор

Hello again, glad to see you still make some quality content. Didn't know about type hinting in Python, even when I write in it all the time. Thanks!

igornowicki
Автор

Thanks for the video, I remember back when python added type hints but I haven't really looked at the typing module before seeing this

johnmccrary
Автор

8:01 the funniest moment I've seen in a dev video. 🤣

ringyring
Автор

A very nice pace and good explanation. Gut gemacht.

DreySF
Автор

Nice and educative video format, liked it a lot!

vnikolayev
Автор

This was really good. Good enough to subscribe to.

drooten
Автор

3:25 it would be great if you can make more videos on data structures

drac
Автор

Wow, echt super, danke! Have used typescript? Why is it that typescript is discussed so often, but so many people are ignorant of pythons type system?

theradlectures
Автор

Hi please can you make a playlist for all the data-structure implementation using python

sillytechy
Автор

Do you have any heuristics or "Rules of Thumb" that you follow for when typing is worth the effort?

For example:
"Always use types no matter what!"

OR

"Add types in function signatures for functions being called from outside the file they are defined in"

DevOpsDirective
Автор

4:15, I think, we can now use left: ClassVar[Any] = 10, right? or 'ClassVar[Opional[Any]]'?

prashantlawhatre
Автор

Can you also make a video on NewType because I dont actually get it where can we use it. I have read a lot about it in documentation but still I dont get what is its use and where it should be used. TypeVar and NewType are quite similar.

pkavenger
Автор

when can we have a data structures and algo video out eagerly waiting for it

chandrakantthangapalam