New In Python 3.12: Type Statement

preview_player
Показать описание
New in Python 3.12, the type statement! Now we can use "type" to create type aliases in Python.

▶ Become job-ready with Python:

▶ Follow me on Instagram:

00:00 Bye Bye TypeAlias
00:55 New in Python 3.12
01:33 Forward referencing
02:04 Generics
02:29 What do you think?
Рекомендации по теме
Комментарии
Автор

I completely missed this when I was doing my research on 3.12! This is SO much nicer than the old system in so many ways, definitely long overdue.

Carberra
Автор

nice, clean and fast to type out, that's what we like about python (and all the libs :D) --> good change

FireSnake
Автор

I am SO glad we can now reference class types before they are defined. You don't know how much I got annoyed at the fact that it wasn't possible in previous versions of Python.

Arsngrobg
Автор

I love your videos really well constructed and great content. Though am I missing something, Why does everyone want explicit typing in Python, the point is not to. I love using 25 * "_" to make lines. types break this idea and more.

adam_fakes
Автор

Python really needs an option to toggle strong typing, like php

chrikke
Автор

It is so much cleaner and really simple to use 🤩

sattineez
Автор

explain more of generic types plz as you didn't give some examples😢, thx bro.

abdullahsaid
Автор

"alias" is pronouced with an "A" as in "hay", "bay", "OK", "ray", "say", "day", not as in "ha-ha-ha". Welcome to the wonderful world of English

TomLeg
Автор

you forgot about the bound with the type parameter like:
type MyIntegerSeq[T: int] = Sequence[T]

davidm.bm
Автор

weird, im getting red highlight when i use [T], even tho i have 3.12.2. i also get it when i have type in front of the specified kind.

This doesnt seem to be alerting Pycharm of anything tho, and theres nothing in red there:

IntOrStr = list | str

darcash
Автор

I wish i could update to 3.12 but the library I heavily depend on doesn't work on 3.12

anamoyeee
Автор

This looks too cpp, I still perfer the colon syntax

Lokdora
Автор

They should have used another keyword imo. Type is already a function

flamendless
Автор

I hope the IntOrStr type is a joke. Right?

maswinkels