Yes, it's true that if you want to write performant code then using C or Rust is better. However just because you're writing Python doesn't mean performance isn't important at all. Python is such a widely used language, and is run at scale. Any performance improvements to CPython will have knock on effects to all Python code and reduce energy consumption and wasted computation on a global scale
For us, its true we don't need multi-threaded Python very often. However, we just completed a project where we used an asynchronous design which had to contain several worker type functions that each had to be started as a task (to work with our async core). This works because the project does mostly I/O, even though one task does compress data. If we need more throughput, we'll get blocked by compressing and need more CPU power and the free thread improvement will then be beneficial. There has been and still are good reasons to use async, threaded and multiprocess application designs.
@@ArjanCodes well since you spent three minutes talking about it, it would be good if you add a caption to your video to make sure you aren't feeding people bad information.
Love your videos! Been a subscriber for a couple years. Appreciate all that you do to keep pythonistas informed! If it's not too much trouble, cropping your videos to keep shaking imacs and macbooks out of the frame would be less distracting. I do enjoy seeing your nice office space though!
I only read the free-threaded mode (PEP 703), and a Just-In-Time compiler (PEP 744) in depth. IS great to see they try to fix float point arithmetic with fma()
- great video, thank youu - the garbage collection part is insightful but I think we need more details (could be in a separate video) - the JIT section needed at least one working example using the `--enable-experimental-jit` flag great effort as usual, keep it up
I'm much more interested in the GC and JIT aspects of Python 3.13. GIL removal is not really important for me. Based on some benchmarks already floating around it seems that these 2 improvements indeed provide some observable performance over 3.12.
A JIT? About freaking time! Common Lisp mastered this by early 90s and of course Java had it later in 90s. It seems pretty weak and not true to machine code JIT so far. Pypy is NOT true JIT.. Removing GIL is something I have wanted from the beginning of my Python journey - especially coming from other languages with no such restriction.
I would imagine free threaded could have performance increases in machine learning, maybe when moving data to and from the GPU, i would guess you would still have to test whether it would be better just to set a high number of workers in Pytorch...
Hope the JIT Compiler will make code execution really faster. After having seen multiprocessing working nicely (at least on linux LOL) and LOL level stuff such as shared memory and asyncio beinh single or multithreaded doesnt feel so important anymore imo.
Hello Arjan, Thanks for the review. I would be interested in how this new JIT compiler feature relates to the NUMBA package with which we can JIT compile Python functions. The long-term vision with this is to make JIT compilation native and replace NUMBA?
JIT compilation in numba uses LLVM and is aimed at high performance, at the cost of longer compile times. Python's JIT is a relatively simple JIT that doesn't do a lot of optimizations, like LLVM does. In the future, they'll probably do more work to optimize it further but I doubt it would ever reach the same level of performance
@ArjanCodes I think you're doing great work @ArjanCodes. You always have something interesting to tell us and you do it in a friendly and accessible way, informed by your experience. I (and, I expect, many others) would love it if you would make a video about how you produce these videos. The lowdown on recording hardware, editing, lighting, audio and video formats, software used, propitiating the RUclips algorithm etc., the step-by-step workflow; a metavideo if you like... I'd say many of your subscribers would be fascinated to learn about your process in this respect.
Be carefull if you migrate to 3.13 from an older version, I tried to reinstall my libs with "pip install -r requirements.txt" and fall into a lot of issues, (missing rust/cargo, missing VS CODE libs ...) back to 3.12.7 and installation was successfull !! I'll install it for test as a second environment but will wait a moment before migrating to 3.13
Yep, if you need performance, choose another language . I think that similarly the addition of GC tuning is also a bit humoress, I mean at a certain point you are trying to manage memory, and there again it would be advisable to switch to a low level lang like C (friends don´t let friends enter the Rust cult lol) for example. But , yeah nice to see they are tinkering with the aim of improving. Great video!
if you update your pyenv you can get 3.13.0 directly and not the rc version. we just updated pyenv to include the 3.13.0 :D Awesome video as always Arjan. Is 'j' silent in your name? I always pronounce it as silent. :P
Type hints can be used in a string to avoid issues with future declarations. In this case, since you're still in the `Node` class definition, you can't refer to `Node` without an error, so you can write `"Node"`, which as a string, does not reference an undefined variable. I think technically the "better" way to write the type hint would be `Optional[Self]`. `Self` (I think introduced in Py 3.12) refers to the class without needing to use quotes. However, I think the type hint he used is more clear to a general audience.
Garbage collection is huge in my time critical embedded world. Very excited to see this getting some love. I've very much been enjoying using Python for embedded engineering the last couple of years. It's significantly quicker to develop code and reason about old code in Python than my old beloved C++.
I like the new clearer error messages, but I can't get it to run from VSCode in interactive (shift-enter) mode. It seems to cascade extra indents when defining a function so hence errors + can't install Jupiter/ipykernel from pip to run it via interactive Jupiter mode. So, for now, I'm back on 3.12, waiting for the bug fixes and pip modules to catch up.
Would be nice to have a Python beginner's+intermediate course with small projects and leetcode stuff that teaches us how to think like a programmer. I will wait for the day you release one. Thank you in advance.
Around 9:20 I don't like it. If dunder init takes 1 attribute, then the instance should have one attribute. info='worker' should be a class attribute, since it's the same for all instances of the Worker class. A video on the horrors of bad instantiation practices (setting would-be class attributes, nullary instantiation followed by, barf.. setters...a major problem with Java ppl, and the greatest sin: doing work!) would be helpful to a lot of pythoneers.
Hi Arjan , do you have any mentorship help for python. I have been working with python for 2 years now hut i feel i am still at beginner level . I do work and make scripts but i feel its still not good as i find my self breaking prod. And I don't like the feeling of not being able to see through things which could have been obvious
Hi, I don’t offer one-on-one mentorship but I do have courses on both Python and software design. You could also join my Discord server (discord.arjan.codes). There are some experienced people there who offer mentorship.
Hey man First of all, thank you so much for the great videos and NO THEY ARE NOT GARBAGE Also yes, if you can make a video about the IOS Support and explain it or experiment with it, that would be very educational and helpful Thank you again ...
So in summary, multithreading with no GIL is exactly as fast as multiprocessing with GIL, in all cases I've seen so far. And ST/MP gets slower. Seems not really worth it for the average developer.
ST is only slightly slower for some situations. Most of the time it's either not perceptible or no penalty. The improvements of GC (and later on, the speed boost of JIT) will more than make up for it.
From a video production perspective, having squiggly red lines all over your editor is quite annoying, comparing this 9:56 to this 11:18 tell me wich one you prefer to look at? keep the correctness aside, and don't try to PEP me with how it should be, its visually unpleasant!
You can disable the underlining if you don't want to be warned that you have probably fucked up. I like it, saves a lot of debugging and imposed a standard that my whole team can work to easily so we can pick up each other's code without having our own confusing nuances
To be honest, this upgrade is a bit disappointing. I thought python 3.13 would support much better type hints. It seems like I have to wait for 4.0 or something.
I still try that at least thrice a day. 😅 I would love it if they made x.method() equivalent with method(x) for keywords though. I think it's len(x) that I tend to use the wrong way ( x.len() ) around a lot. Or was it the other way round? X does not have a method y() is so irksome an error. Does "".print() work?
Software engineers funny :) "Nice extra thing to have"? at 6:20. Am sure it took 10s of hours to implement this and we know but we brush it off as "nice". But love your youtube garbage, it's the best
Another release of python, continuing to contribute to my endless pain of trying to install python projects without problems. Shit language with shit tooling, will never like it
20 minutes of watching your video saved me 5 minutes looking at python's release notes. It was worth it, thanks Arjan!
lol
It took me and my team around 40 hours to produce the video. That was also totally worth it 😁.
Free threaded learning is so much faster!
ikr!
@@ArjanCodeshow big is your team? Mainly an editor I take it? Just curious
You're the only reason my python is top quality thank you ....please don't stop.
Your channel is a gem❤❤
Thank you so much! You’re most welcome.
As a python dev from almost a decade , i really enjoy your videos man . Keep em coming !!
Thanks!
Yes, it's true that if you want to write performant code then using C or Rust is better. However just because you're writing Python doesn't mean performance isn't important at all. Python is such a widely used language, and is run at scale. Any performance improvements to CPython will have knock on effects to all Python code and reduce energy consumption and wasted computation on a global scale
For us, its true we don't need multi-threaded Python very often. However, we just completed a project where we used an asynchronous design which had to contain several worker type functions that each had to be started as a task (to work with our async core). This works because the project does mostly I/O, even though one task does compress data. If we need more throughput, we'll get blocked by compressing and need more CPU power and the free thread improvement will then be beneficial. There has been and still are good reasons to use async, threaded and multiprocess application designs.
the incremental GC was removed in 3.13.0rc3 (check the 3.13 changelog for details) due to a performance regression the sphinx team found.
Good to know!
@@ArjanCodes well since you spent three minutes talking about it, it would be good if you add a caption to your video to make sure you aren't feeding people bad information.
Love your videos! Been a subscriber for a couple years. Appreciate all that you do to keep pythonistas informed!
If it's not too much trouble, cropping your videos to keep shaking imacs and macbooks out of the frame would be less distracting. I do enjoy seeing your nice office space though!
Hey, I saw this guy yesterday as a speaker at the dutch pycon!
Hope you enjoyed the conference!
@@ArjanCodes 👍
Is it on RUclips? I'd love to see ut
Good rundown, thanks. Just FYI, you never needed `quit()`, from the Python shell, as Ctrl+D quits instantly if the current line is empty.
I only read the free-threaded mode (PEP 703), and a Just-In-Time compiler (PEP 744) in depth. IS great to see they try to fix float point arithmetic with fma()
- great video, thank youu
- the garbage collection part is insightful but I think we need more details (could be in a separate video)
- the JIT section needed at least one working example using the `--enable-experimental-jit` flag
great effort as usual, keep it up
Big hand for the team as well as this excellent intro!!
It woud be great a video about running C/C++ code in python
Thanks so much for this video. The new and updated features are great. But, truly can't wait for pi-thon.
Pithon should handle circular references.
I'm much more interested in the GC and JIT aspects of Python 3.13. GIL removal is not really important for me. Based on some benchmarks already floating around it seems that these 2 improvements indeed provide some observable performance over 3.12.
Oh Arjan! Today I will be in Utrecht 💫
Enjoy!
A JIT? About freaking time! Common Lisp mastered this by early 90s and of course Java had it later in 90s. It seems pretty weak and not true to machine code JIT so far.
Pypy is NOT true JIT.. Removing GIL is something I have wanted from the beginning of my Python journey - especially coming from other languages with no such restriction.
liked & shared!. you and your team ate!, no crumbs left, sir!!!! Thankyou for all of your videos.
Thanks so much!
quit() and help() was pissing me off for such a long time 😂
There are a few improvements in pdb with breakpoint(). More will come with 3.14.
I would imagine free threaded could have performance increases in machine learning, maybe when moving data to and from the GPU, i would guess you would still have to test whether it would be better just to set a high number of workers in Pytorch...
I totally didn't have python:latest in my production build which broke my app the other day
If you did, that would be a rookie mistake!
Glad you didn’t 😉
@@therealslimaddy Saaaaaaame here .... :D
Nice call, that would've been a shame 😏
@@therealslimaddyindeed, truly a close call of all times
Arjan, this is awesome!
I'm happy you like it!
Nice ❤❤❤🎉
Thanks 🤗
Hope the JIT Compiler will make code execution really faster. After having seen multiprocessing working nicely (at least on linux LOL) and LOL level stuff such as shared memory and asyncio beinh single or multithreaded doesnt feel so important anymore imo.
Hello Arjan,
Thanks for the review. I would be interested in how this new JIT compiler feature relates to the NUMBA package with which we can JIT compile Python functions. The long-term vision with this is to make JIT compilation native and replace NUMBA?
JIT compilation in numba uses LLVM and is aimed at high performance, at the cost of longer compile times. Python's JIT is a relatively simple JIT that doesn't do a lot of optimizations, like LLVM does. In the future, they'll probably do more work to optimize it further but I doubt it would ever reach the same level of performance
@ArjanCodes I think you're doing great work @ArjanCodes. You always have something interesting to tell us and you do it in a friendly and accessible way, informed by your experience. I (and, I expect, many others) would love it if you would make a video about how you produce these videos. The lowdown on recording hardware, editing, lighting, audio and video formats, software used, propitiating the RUclips algorithm etc., the step-by-step workflow; a metavideo if you like... I'd say many of your subscribers would be fascinated to learn about your process in this respect.
Thank you for the kind words! I'll definitely note this suggestion for a future video :)
Be carefull if you migrate to 3.13 from an older version, I tried to reinstall my libs with "pip install -r requirements.txt" and fall into a lot of issues, (missing rust/cargo, missing VS CODE libs ...) back to 3.12.7 and installation was successfull !! I'll install it for test as a second environment but will wait a moment before migrating to 3.13
Yep, if you need performance, choose another language . I think that similarly the addition of GC tuning is also a bit humoress, I mean at a certain point you are trying to manage memory, and there again it would be advisable to switch to a low level lang like C (friends don´t let friends enter the Rust cult lol) for example. But , yeah nice to see they are tinkering with the aim of improving.
Great video!
if you update your pyenv you can get 3.13.0 directly and not the rc version. we just updated pyenv to include the 3.13.0 :D
Awesome video as always Arjan. Is 'j' silent in your name? I always pronounce it as silent. :P
he mentioned that the video was recorded before the release
The j is pronounced like the y in yellow
@@sasgaro oh okay. we do releases in pyenv later so I thought maybe he hadn't updated it yet.
@@VeejayRampay Thanks
I am curious about the threaded error handling changes, but I wont have time for a while to have a look. Do you have any info on the changes?
Cool 😊😊
I also love them ❤
Thank you :)
Existing For π 3.14 Version 💪💪💪
Any idea were to get the free-threading variant for other platforms then Linux? E.g. Windows x86_64?
Can you explain the type hinting syntax in the Node class, with the double quotes?
Type hints can be used in a string to avoid issues with future declarations. In this case, since you're still in the `Node` class definition, you can't refer to `Node` without an error, so you can write `"Node"`, which as a string, does not reference an undefined variable.
I think technically the "better" way to write the type hint would be `Optional[Self]`. `Self` (I think introduced in Py 3.12) refers to the class without needing to use quotes. However, I think the type hint he used is more clear to a general audience.
Garbage collection is huge in my time critical embedded world. Very excited to see this getting some love. I've very much been enjoying using Python for embedded engineering the last couple of years. It's significantly quicker to develop code and reason about old code in Python than my old beloved C++.
Have you used MicroPython at all?
@@rdustinlane I have not, no. All the bare metal I've worked on didn't support it either at all, or not enough to make a viable product.
Good 👍
Thank you! Cheers!
In my main project I still have/want to support older Python versions so I can't use any of the newer features :(
7:21 - Fifeteen point six milliseconds? 😀
What's the 3.8 am been using 😮?
Why don't they improve on performance of Python? Is it hard to do so?
@property
def help():
...
@property
def quit():
...
xD
Python 3.13 may not be fully supported by pyttsx3 and its dependencies, such as comtypes.
mannnn how do i fix this please
Can i know how the python non-thread version was install? i can't find it in pyenv.
It only shows till latest 3.13.0 python version
I like the new clearer error messages, but I can't get it to run from VSCode in interactive (shift-enter) mode. It seems to cascade extra indents when defining a function so hence errors + can't install Jupiter/ipykernel from pip to run it via interactive Jupiter mode. So, for now, I'm back on 3.12, waiting for the bug fixes and pip modules to catch up.
Yep… same problem here actually.
@@ArjanCodes Glad it's not just me, I'm sure it'll get sorted pretty quick
Would be nice to have a Python beginner's+intermediate course with small projects and leetcode stuff that teaches us how to think like a programmer.
I will wait for the day you release one. Thank you in advance.
After upgrading it to 3.1.3, nothing works, pip doesnt install anything, all my Programms outputs Errors.. back to 3.12 -.-
First :) (love the videos man)
Glad you like them!
Around 9:20 I don't like it. If dunder init takes 1 attribute, then the instance should have one attribute. info='worker' should be a class attribute, since it's the same for all instances of the Worker class.
A video on the horrors of bad instantiation practices (setting would-be class attributes, nullary instantiation followed by, barf.. setters...a major problem with Java ppl, and the greatest sin: doing work!) would be helpful to a lot of pythoneers.
Hi Arjan , do you have any mentorship help for python.
I have been working with python for 2 years now hut i feel i am still at beginner level . I do work and make scripts but i feel its still not good as i find my self breaking prod. And I don't like the feeling of not being able to see through things which could have been obvious
Hi, I don’t offer one-on-one mentorship but I do have courses on both Python and software design. You could also join my Discord server (discord.arjan.codes). There are some experienced people there who offer mentorship.
The feeling when i find out AI is not the dumb one and i should call that a static attribute not a property without a def 😅
I love JIT and Error Colors.
can i use whisper ai on this version currently?
Typing package will be deprecated??
Where did you get that?
@@efovex5:32 bottom right
I dont understand is_protocol??
Hey man
First of all, thank you so much for the great videos and NO THEY ARE NOT GARBAGE
Also yes, if you can make a video about the IOS Support and explain it or experiment with it, that would be very educational and helpful
Thank you again ...
So in summary, multithreading with no GIL is exactly as fast as multiprocessing with GIL, in all cases I've seen so far. And ST/MP gets slower.
Seems not really worth it for the average developer.
ST is only slightly slower for some situations. Most of the time it's either not perceptible or no penalty. The improvements of GC (and later on, the speed boost of JIT) will more than make up for it.
From a video production perspective, having squiggly red lines all over your editor is quite annoying, comparing this 9:56 to this 11:18 tell me wich one you prefer to look at?
keep the correctness aside, and don't try to PEP me with how it should be, its visually unpleasant!
Blame it on pylance.
You can disable the underlining if you don't want to be warned that you have probably fucked up.
I like it, saves a lot of debugging and imposed a standard that my whole team can work to easily so we can pick up each other's code without having our own confusing nuances
To be honest, this upgrade is a bit disappointing.
I thought python 3.13 would support much better type hints. It seems like I have to wait for 4.0 or something.
What specifically would you like to see changed? I'd love to hear your feedback
keyboard seems to be a Nuphy Air or Halo
Pytube has become useless.
nothing we should know. just fixes. same code run now faster. not again this is how you need code
.
now.. when do we get to write print without parenthesis again? 🤣
I still try that at least thrice a day. 😅
I would love it if they made x.method() equivalent with method(x) for keywords though. I think it's len(x) that I tend to use the wrong way ( x.len() ) around a lot. Or was it the other way round? X does not have a method y() is so irksome an error. Does "".print() work?
Software engineers funny :) "Nice extra thing to have"? at 6:20. Am sure it took 10s of hours to implement this and we know but we brush it off as "nice". But love your youtube garbage, it's the best
new interactive interpreter has no inputrc support, so no vi-keys. massive downgrade for anyone used to vi.
If pi *is* 3.14 then pi is also 3, since there's no reason why we should round to 2 decimals and not to zero decimals.
Third? xdd
Nothing wrong with being third 😁.
Another release of python, continuing to contribute to my endless pain of trying to install python projects without problems.
Shit language with shit tooling, will never like it
But your voice is not listenable clearly
You should use Windows while testing Python....
Python on Mac and Linux is garbage......