ALL of Python 3.13's MAJOR typing changes

preview_player
Показать описание
Python 3.13 released this week, and there was so much to talk about, I didn't really have time to discuss its new typing features! This video rectifies that, by giving them some time to shine.

0:00 - Intro
0:38 - Default values for TypeVars [1-2]
3:08 - The @deprecated decorator [3]
5:21 - ReadOnly values for TypedDicts [4-5]
7:24 - Better type predicates with TypeIs [6-7]
9:55 - Outro



If you want to see more of me, join my Discord server!

I get a lot of people asking, so here's my setup!

Affiliations (I may earn a commission):



If you have any questions, don't hesitate to ask in the comments! I'll try and answer as soon as I can, providing someone else hasn't already done so.

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

Why do you use the old generics syntax for these examples? IMO, it doesn't much sense to use the old syntax when the new one is available. I understand using it for more general videos, so they apply to a wider public, but not here. Regardless, I'd appreciate it if you could show both versions anyway.

Anyway, great video. Hopefully pyright implements the new typing stuff soon.

maleldil
Автор

Thankyou this was a great summary and demo :)

EngineerNick
Автор

7:16 probably the extension is using a older version of pyright or mypy. The extension won't use the pyright/mypy version installed on your environment.

Heavy_Lvy
Автор

Thanks for this. I'm just now catching up on 3.13's features.

A video on support for Protocols would be appreciated. My statically typed brain still can't quite fit itself around Python's protocols using duck typing, and compile-time or run-time predicates verifying that a class conforms to a Protocol would make using Protocols feel like black magic (or pure superstition).

fmitchella
Автор

"Dynamic typing is cool, bro!" Now spend years correcting that shit.

aungthuhein
Автор

Is it possible to back port the new repl to use it with older python versions?

chrism
Автор

What's the benefits of ReadOnly over Final?

murphygreen
Автор

wait I thought that python 3.13 was about using 'type' as a keyword instead of TypeVar

solojazzz
join shbcf.ru