What's new in Python 3.13?

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
it's that time of year again the release of the first beta of a new version of python that may not sound particularly significant but for those that don't know the first Beta release marks the feature freeze for that version meaning that no new features can be added beyond that point this doesn't stop things that are still in development from getting finished in time for the final release but does mean that no more new ideas can be marked for 3.13 it's a good time to have a look at how things are going so let's get on with it shall we let's start with what's available to use right now one of the more exciting bits of news surrounding 3.13 is the new copy and paste just in time compiler that was added a few months ago for those not in the know a jit compiler compiles code just before it's due to run for the first time something especially useful for code that would be run a lot number is perhaps the most notable existence of a jit compiler in Python and pipy has had one for years but now cpython has one too and it already provides a 2 to 9% performance boost despite the fact it's still very experimental copy and paste jit compilers haven't been around for very long first proposed by zoo and colad in their 2021 paper but to give a very high level overview of how it works here when python itself is compiled it will generate machine code templates for various bik code instructions and Patch these templates in place of those instructions at runtime allowing python to execute the machine code directly for now this only happens when passing the enable experimental jit flag when building from source and will remain that way until it becomes more performant and more stable but so far so awesome iOS is now an officially supported platform outside of Ki and the bware project becoming a tier 3 pep 11 supported platform in English that means there aren't any distributed iOS versions as yet but you could compile an iOS compatible build from source code if you wanted to Android fans don't fret support is still on the way though it just hasn't been implemented quite yet 3.13 becomes the fourth release in a row to boast about improved error messages showing off some pretty cool updates error messages are colored now though I've already covered that in a video a few months ago and the the error system can also now detect whether local modules are shadowing first and third party packages as well as when you've slightly mistyped keyword arguments similarly to how it can detect typos elsewhere neat huh also the deprecated decorator I talked about in the first look video for 3.13 is now available for use just note that type Checkers may need some more time to be fully compatible with this feature especially mypie which hasn't even fully caught up with some of the 3.12 changes now for some things that aren't ready yet but should be by the final release the replacement for Pep 653 is from future import annotation system evaluation of annotations will now be deferred using descriptors the mechanism detailed in pep 649 works by adding a Dunder annotate attribute to all functions and classes which references a function this function will be generated at compile time as in when the bik code is generated and will return an annotations dict for the object at runtime this result is then cached so it can be reused without a performance hit pep 649 aims to do two things one eliminate circular referencing ISS issues by deferring evaluations until after all types are defined and two overcome an issue in pep 653 is implementation where annotations were actually declared as strings instead of references to the actual types the examples do make this look pretty messy at a glance but don't worry all this will happen in the background something that would have been really useful when implementing my sync async hybrid functions is the new type is form this will work very similarly to type guards but allows type Checkers to enforce the else branch in a statement that is if you have a very variable that is a string or an integer and you check whether the type is a string the type Checker will be able to infer the variable is an integer if the check returns false this is not currently possible using typ guards this does mean there are now two ways to do very similar but definitely distinct tasks but the decision was made to not alter or deprecate typ guards Behavior due to backwards compatibility concerns both features I've talked about before it looks like neither the new interpreters module nor the data class field converters will make their way to 3.13 with their respective peps being deferred or still in draft respectively fingers Cross of 3.14 eh we'll finish off by doing a quick fire rundown of some other cool stuff that's been added in time for the beta there's a new replace function in the copy module which allows you to create a modifi copy of an object particularly useful for immutable objects the it tools. batch function now has a strict keyword argument that raises an error if the final batch is smaller than the rest similarly to how it works in the zip built-in function creating path the path objects from uis is now possible using the from U class method you can now check whether a class is a protocol using the new type in. is protocol function and most importantly of all subprocess should now be faster on free BSD and Solaris systems hell yeah this is far from an exhaustive list of everything that's new but that covers just about everything important that I didn't talk about in the first look video let me know in the comments what you're most excited for in the upom 3.13 release like if you enjoyed And subscribe to keep up to date with the latest 3.13 news thank you to all my amazing patrons and members on screen now especially mazard rushman the third for being so generous and I'll see you next time for whatever we do next
Info
Channel: Carberra
Views: 76,890
Rating: undefined out of 5
Keywords: pyfhon, pytho, pytbon, pytjon, ptyhon, pytyon, ptthon, pyyhon, pythn, pythoh, pythpn, ython, pytgon, pyhon, pytohn, phthon, oython, pthon, pyghon, pythoj, pythno, pythkn, ypthon, pytuon, lython, pyrhon, pythom, pythob, puthon, pgthon, python, pyhton, pythln, pythin, pytnon, pyton
Id: UpzrPHG_6vg
Channel Id: undefined
Length: 5min 7sec (307 seconds)
Published: Tue May 07 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.