Python 3.12 is HERE!

preview_player
Показать описание
What's new in Python 3.12

Python 3.12 has just released! Let's take a look at all the new features!

SUPPORT ME ⭐
---------------------------------------------------
Sign up on Patreon to get your donor role and early access to videos!

Feeling generous but don't have a Patreon? Donate via PayPal! (No sign up needed.)

Want to donate crypto? Check out the rest of my supported donations on my website!

Top patrons and donors: Jameson, Laura M, Dragos C, Vahnekie, Neel R, Matt R, Johan A, Casey G, Mark M, Mutual Information, Pi

BE ACTIVE IN MY COMMUNITY 😄
---------------------------------------------------

CHAPTERS
---------------------------------------------------
0:00 Intro
0:12 Type params
1:51 f-strings in the grammar
2:30 A per-interpreter GIL
3:51 Low-impact monitoring
5:03 Immortal objects
6:13 Comprehension inlining
7:09 Buffer protocol in Python
7:47 TypedDict annotating kwargs
9:00 typing override decorator
10:30 Unstable C-API tier
11:09 Bye bye setuptools
11:50 itertools batched
12:09 THE BEST PART
12:25 Thanks
Рекомендации по теме
Комментарии
Автор

The comprehension change is a 10/10. Literally no change to your code required but comprehensions become twice as fast.

NotAUtubeCeleb
Автор

This is so cool, I can’t wait to use this in 2027 when it’s supported by all packages and about to be depreciated

yourmomsboyfriend
Автор

Great to see Python taking some inspiration from C++ such as typing and incomprehensible syntax.

jamesflames
Автор

the f string change is so helpful, ive run into that one quite a few times

Knomi
Автор

I think with `kwargs`, it's not that having the same type for each `kwarg` is a natural solution but it's more like it's consistent with the typing of `args` where it *does* make more sense to have the same type for each arg.

rx_mc
Автор

6:30 Just a note that, as with any function, generation of the code happens only once, at compile time, but creation of the function _object_ (ref to code + environment binding) happens every time that statement is executed.

lawrencedoliveiro
Автор

As someone who maintains a lot of packages.. 3.7 disappearing is definitely the best. Can we fast track it to 3.10? :D

SuperGrimmy
Автор

im already excited for python pi (or just python 3.14) as it is now very very close

wChris_
Автор

11:51 There's exactly one problem with `itertools.batched`, it's passed tense. All the other itertools are present tense, i.e. `groupby` rather than `groupedby`.

Kruglord
Автор

As an NVIDIA Jetson which shipped Ubuntu 20.04 (i.e. python38) and lots of proprietary NVIDIA libraries which only have python binding for 3.8, I start sweating at the thought of 3.8 being dropped next year.

stonemannerie
Автор

1:52 and it used to be that you coudln't use backslashes in f-strings. Which bit a lot of people in the backside.

con-f-use
Автор

Hi James,
if you are gathering points for a new "Nooby Python habits" video, I might have one. Not sure if I missed it in the list or it is just so stupid that you did not think about it. In most of my codes I initialized instance attributes as class attributes instead of initializing them in the __init__() method. Mainly to make the code shorter and more readable. I mean, sure... Those are shared by all instances of a class, but if they are immutable objects they work like instance attributes. I realized my very stupid nooby habit when I created mutable objects (list and dict in my case) which is then shared between all instances. I think for newcomer this behavior is not quite obvious and can lead to silent misbehavior. I thought it is worth mentioning.

Thank you for your great videos. Even considering the statement above, I'd say they made me a quite good Python dev :)

Ballrock
Автор

The new generic type syntax is sooo welcome

Darmo_
Автор

8/10 video. im gonna start using itertools batched. f string stuff was annoying having to use different quotes, etc. kinda wish single-quotes in python weren't a thing.

cleverclover
Автор

Please let the 3.14 release be called “Pi-thon” 😂

cougar
Автор

Would like to hear more about your other preferred utils. How is batched implemented over an unindexed object, does it cast to a list or uses a generator ?

nocturnomedieval
Автор

The buffer protocol is nice. Many times I've come across functions in the standard library that say they work with anything that implements the buffer protocol, when it's C api only and only bytes and bytearray implement it.
Not that useful but kinda nice.

Tomyb
Автор

2:05 spooky, I literally just got bit by that this morning; I had no idea that's being/been addressed

codegeek
Автор

"and python 3.8 has a year to go so I can start pushing clients to upgrade to 3.9" :D

calum.macleod
Автор

10:26: C++ typing is a good thing! Typing has the two purposes of 1. helping the programmer catch errors, 2. creating an efficient compiler producing lightning fast machine code (if the programmer chooses to). If the answer on purpose 2. is "use another language" then Python isn't that language.

rursus