What's coming in Python 3.14?

preview_player
Показать описание
Hehe, π-thon.

0:00 - Intro [1-3]
0:32 - The almost disasterous 3.13 release [4-7]
1:09 - Deferred evaluation of type annotations [6, 8-10]
2:12 - Template strings (or t-strings) [11-16c]
3:49 - TypedDict with typed extra items [17-18]
4:55 - Shorthand syntax for keyword arguments [19-21]
5:41 - Continued work on free-threading, JIT, and PyREPL! [22]
6:00 - 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
Рекомендации по теме
Комментарии
Автор

PyPi requires something REALLY special, either in terms of functionality, or in terms of easter eggs.

dyvel
Автор

I want them to solve cycle imports so one don't have to think about that.

Also anything that helps with type based tooling and lints.

Lis-
Автор

I think I would even prefer =kwarg than kwarg=, having a trailing = is so ugly

yibowei
Автор

I would like to see the Elvis Operator

brainforest
Автор

honestly i really love the t-string stuff, they seem like a nice addition, but im kinda of mad about the new keyword argument syntax, cause that will break a lot of things, it also really confusing

Elia
Автор

Shorthand argument syntax will be good for unittest subTest, since the argument is always the name of the variable.

Автор

The walrus operator is controversial? It's the best thing ever.

fg
Автор

I feature I'm been looking for for years that doesn't seem to be on anyone's radar is types in python api documentation. Just about every time I'm looking through docs I need to know the types, especially return types. For example, just seeing that some pandas Dataframe methods sometimes return of Series instead of a Dataframe and what methods sometimes return null would save a lot of bugs and headache.

Sean_neaS
Автор

The Template() thing as a PEP is silly.
> You can implement it with a normal class, and a substitute method so it doesn't make sense to add it as a language feature.
> No clear indication of where the value name ends. Do we have to add extra whitespace to isolate the name of the variable ?
The tagged template literals however would be really powerful.

macerdough
Автор

The shorthand syntax for dictionary construction is sorely needed. But.... the proposed syntax for function invocation is, interesting. I would use it for sure. But i think javascript has it better; allow de-structuring in function arguments, allow shorthand dictionary construction. If only javascript had named argument in function calls it would be the undisputed champion of ergonomic argument passing.

EngineerNick
Автор

I'd REALLY like to see something like A & B for types. If I do `x: A & B`, it means `x` is both of type `A` and of type `B` - at the same time. This is useful when mixing normal types with protocols, mainly for Exceptions. For instance, when doing something like `e: Exception & Serializable`, where `Serializable` is a protocol. I had the need for this many times when working with protocols, because there's no way to encode (in a Protocol) the fact that something can be raised (i.e. is an Exception). OR, I'd be happy with an ExceptionProtocol, but that sounds stupid.

rafaelclp
Автор

I like the idea of the shorthand syntax but a "foo=" without an rvalue just hurts my eyes. Maybe a dummy value like "foo= %" would be a fair compromise? It would also minimize unwanted usage of the feature!

amos
Автор

Looking at this after moving to a TypeScript ecosystem only reinforces every reason I left Python. I can enjoy a lot of these features today. Granted there trade-offs. But Python has really fallen behind.

AvihuTurzion
Автор

The shorthand syntax for me is AMAZING. This would greatly improve my function calling for me and my users. I have an extremely strict domain-driven naming scheme, so this would be great. Currently, I have to write exactly what is shown in the example all the time for almost every function call.

It is annoying, and often I, to save some characters, simply go by position, which is dangerous. I am looking forward to this change and hope they add it to older versions as well.

ChristophBackhaus
Автор

short-hand - no. Keep it readable. Yes, it is readable but not if you have not run into it before you might not be sure of what the code is doing.

mjss
Автор

The fact that the python ecosystem is so fragmented is very off putting. While languages like R and Julia are happy to work with all packages in the latest version, python packages are still riddled with legacy dependencies from 3.8 or before

juvencus_
Автор

Alright everyone, get ready for the πthon

waiitwhaat
Автор

omg shorthand syntax yesss pleeeeaasssse

FlowerBoyWorld
Автор

what's wrong with the kwargs=, shorthand? this is like the one feature i knew before watching this video is coming in 3.14 and i was looking forward to it a lot...! it just feels like a nice feature

anamoyeee
Автор

None of the proposals get me truly excited. Why can't they focus on making the language as fast as C++ by implementing all of the sophisticated optimizations of a modern compiler?

DirkTomandl