python 3.12 release highlights (beginner - advanced) anthony explains #548

preview_player
Показать описание
it's here! with ugly new typing syntax and infinitely nestable fstrings and one of the funniest changes I've seen in a while -- python 3.12!

==========

I won't ask for subscriptions / likes / comments in videos but it really helps the channel. If you have any suggestions or things you'd like to see please comment below!
Рекомендации по теме
Комментарии
Автор

Thanks for not trimming it down for the stupid youtube algorithm.

rednafi
Автор

2:13: infinitely nestable f-strings
9:16 the modules that are going away: 'distutils' module; 11:48: the 'imp' module
12:45 type variables/parameters/aliases (allows Generics to be specified easier)

RedShipsofSpainAgain
Автор

This was great, I look forward to getting to play with these in 3 years when python 3.12 is a few months from EOL

DavidDellsperger
Автор

def x[T, U, V](y: U, z: V) -> list[T]: pass

*holds head*

pylang
Автор

Thanks for all the amazing content you share with us... Pretty cool that you get to work in core python projects and even talking to Guido! Cudos for you! Looking foward to use your pre-commit library, im still figuring it out.. Greetings from Chile!

SebaSalinas
Автор

You did the $ variables in pdb correctly, they stay between stack changes, not continuing execution (they are cleared then).

batched doesn’t error, you were unpacking it assuming it returned the same number each time. For its use case (batching items for multiprocessing), that’s exactly what you want and it’s a benefit over the existing helpers. Just don’t unpack assuming identical batch sizes. :)

henryschreiner
Автор

In ISO 8601 monday is the start of the week + Week with weekday notation e.g. 2023‐W32‐1 is a monday

lucasfcnunes
Автор

This new generics syntax and the type keyword is just a shocker honestly. Couple more versions - and the language becomes non-recognizable to people used to 3.7 or something :)

gcydgmm
Автор

To me, the point of itertools.batched _is_ that the final "element" can contain fewer elements! Many algorithms are memory intensive, so being able to cap the number of elements for each batch means you can limit how many subelements are handled, rather than being a zip-replacement. So rather you would have:

for batch in itertools.batched(it, 2):
if len(batch) == 1:
process_one(batch[0])
elif len(batch) == 2:
process_two(batch)
else:
continue

Or something smarter. In machine learning fields, this is a common way to handle training data, and while there are other tools for this there, it is nice to have a python implementation for this. As recently as a week before the release of python 3.12 I had to install the more itertools package to get this function for a project.

Gaivs
Автор

The new generic syntax has some heavy Java vibes lol

edit: the override decorator aswell

numeritos
Автор

I like the override decorator. Explicit is better than implicit, right? 😊

traal
Автор

Removal of distutils can hurt only in one circumstance – where you don't have access to pip at all, and you're stuck with whatever standard library can provide to you, either as learning excercise or your boss have panic attack when hears about anything 'third-party' :)

dstinYwOw
Автор

I added those enums in calendar 😁, that was I guess my first PR to Cpython.

princeroshan
Автор

Can someone add timestamps? A tldr and a way to jump into detail is really helpful

yorailevi
Автор

Appreciate the dissect on what's comin. Neat find on the NUL byte too

aaronater
Автор

I love the fact that Anthony mostly wings his videos! Very cool ♥

amir.hessam
Автор

Great video! The function annotations look... goofy. However I'm glad to hear that list comps (and I assume dict comps as well, but I'd have to look) got a speedup that seems relatively trivial!

Squeemos
Автор

You are making amazing videos and I'm watching them not for fun but as an actual short/dense overview of new features or some tweaks and tricks. I have learn a lot from your videos. I appreciate your work.

RuslanKovtun
Автор

Unpacking of the TypedDict is a blessing

hardikojha
Автор

Instead of /dev/stdin you can just not give tokenize any file argument and it'll default to stdin

sadhlife