Python 3.12 release: The BIGGEST in 15 years

Sdílet
Vložit
  • čas přidán 21. 07. 2024
  • Python 3.12 is easily the biggest release since...well, perhaps 3.0! It's packed full of game-changing features and improvements, and I can't wait to tell you about them!
    Below is a list of chapters cited against any relevant references which you'll find further down. It's absolutely worth doing further reading using these if you want to learn more!
    Chapters:
    0:00 - Intro
    0:21 - A per-interpreter GIL [1-5]
    1:59 - Performance improvements [6]
    2:39 - Syntactic formalisation of f-strings [6-8]
    3:11 - Type parameter syntax [9]
    3:38 - Override decorator [10-11]
    4:06 - Using TypedDict for more precise **kwargs typing [12]
    4:28 - Double Standards! [6, 13]
    6:22 - Removals [6, 14-15]
    6:56 - Deprecations [6, 16]
    7:19 - Outro
    References:
    [1] docs.python.org/3/whatsnew/3....
    [2] peps.python.org/pep-0684
    [3] www.artima.com/weblogs/viewpo...
    [4] wiki.python.org/moin/GlobalIn...
    [5] peps.python.org/pep-0554
    [6] docs.python.org/3.12/whatsnew...
    [7] peps.python.org/pep-0701
    [8] peps.python.org/pep-0617
    [9] peps.python.org/pep-0695
    [10] peps.python.org/pep-0698
    [11] pypi.org/project/overrides
    [12] peps.python.org/pep-0692
    [13] docs.python.org/3.12/library/...
    [14] setuptools.pypa.io/en/latest/...
    [15] peps.python.org/pep-0623
    [16] docs.python.org/3.12/library/...
    -
    If you enjoy my content, consider supporting me on Patreon or becoming a member!
    patreon.carberra.xyz
    join.carberra.xyz
    If you need help with anything, feel free to join the Discord server:
    discord.carberra.xyz
    I get a lot of people asking, so here's my Visual Studio Code setup!
    • My Visual Studio Code ...
    -
    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

Komentáře • 75

  • @williamsquires3070
    @williamsquires3070 Před 9 měsíci +185

    I’m waiting for Pi-thon (3.14). 😊

    • @Carberra
      @Carberra  Před 9 měsíci +24

      Oh wow, I'll have to make a note of that!

    • @ocaly
      @ocaly Před 9 měsíci +1

      Underrated

    • @christopherscottdempwolf5759
      @christopherscottdempwolf5759 Před 9 měsíci

      You beat me to it! 👏👏👏

    • @csanadtemesvari9251
      @csanadtemesvari9251 Před 9 měsíci

      🙄

    • @taimunozhan
      @taimunozhan Před 9 měsíci

      Does Python have some semantic versioning schema they are required to adhere to or are they free to keep the 3.14 forever and subsubversion that instead of ever getting to 3.15?

  • @pietraderdetective8953
    @pietraderdetective8953 Před 9 měsíci +37

    Great to hear about the performance improvements! I remember the core devs targeting a 15% overall improvement per new release, I hope it materializes.

    • @Carberra
      @Carberra  Před 9 měsíci +3

      Wow, that would be amazing if those targets were hit! I wonder how 3.11 did on that front as well, would be interesting to see how close they've come in the releases since Faster CPython was a thing.

  • @mrdogebro
    @mrdogebro Před 9 měsíci +4

    Great video! Excited about all the new features

    • @Carberra
      @Carberra  Před 9 měsíci +1

      Glad you enjoyed it! Yeah, should be a fun one!

  • @shamaldesilva9533
    @shamaldesilva9533 Před 9 měsíci +20

    Super excited about the sub interpreters. But im a bit confused about how it differes from multiprocessing 😮

    • @Carberra
      @Carberra  Před 9 měsíci +10

      I believe the difference is that multiprocessing is based around *multiple processes*, where subinterpreters are *isolated threads*. In theory, the overheads that come with multiprocessing should be mitigated.
      The "Concerns" section in PEP 554 justifies the existance of subinpreters in a world where the other types exist, so it may be worth reading that: peps.python.org/pep-0554/#concerns

  • @hebozhe
    @hebozhe Před 9 měsíci +4

    Only really interested in true multithreading once it becomes a thing and accessible in pure Python, so I'm sitting out the improvements here and migrating code to Go in the meantime.

  • @jaoanunes1438
    @jaoanunes1438 Před 9 měsíci

    i didn't undertand half of what you said in the video but i loved your video and i love python so you got a like and a new sub

  • @arnabsaha1817
    @arnabsaha1817 Před 9 měsíci +1

    Does the latest Tensorflow Extended have a support for the latest python 3.12 or even 3.11 . I'm just having one hell of a time using TFX in my local.

    • @Carberra
      @Carberra  Před 9 měsíci

      Tensorflow is often pretty late to the party with new releases, so I'd be surprised if it supported it yet. I don't know for sure though.

  • @SaiKumar-jy5ub
    @SaiKumar-jy5ub Před 9 měsíci +7

    Do you have an idea on when 3.12 stable version will hit the market?

  • @illegalsmirf
    @illegalsmirf Před 9 měsíci +1

    I hear that version 3.7 is losing support. Does that mean everything written in older versions of Python 3 will stop working, like what happened to Python 2?

    • @Carberra
      @Carberra  Před 9 měsíci +4

      Python 3.7 is just at end of life, everything written to support 3.7 will still support it for now, though there's nothing to say things written in 3.7 will work on 3.12. It just depends exactly what libraries etc. they use.

  • @dailypotstirrer
    @dailypotstirrer Před 9 měsíci +3

    Already, unable to successfully install any jupyter extensions with 3.12.

    • @Carberra
      @Carberra  Před 9 měsíci +1

      There's a chance Jupyter, or extension devs, haven't added support for 3.12 yet. Data science tools and libraries do tend to sit a little behind with support, so will probably be available soon™.

    • @lorenzomonacelli
      @lorenzomonacelli Před 9 měsíci

      They removed setup tools from and the numpy distutils cannot anymore be used in 3.12. As a package maintainer whose software contains a lot of Fortran code that only distutils could manage to autocompile, that is a lot of work to migrate the setup of the package just to add support to 3.12. I believe that my library will not support 3.12 in the next few years, unless I get a pull request from some nice guy that decides to do the boring job for me.

    • @dailypotstirrer
      @dailypotstirrer Před 9 měsíci

      @@lorenzomonacelli In the downloads release documentation, under Deprecation, it mentions that distutils module continues under setuptools package. I'd provide the URL here, but it seems CZcams sysadmin 🤡 thinks it is spam and won't let me post it here.

  • @JorgeEscobarMX
    @JorgeEscobarMX Před 6 měsíci

    I wonder if a new GILess python will be released soon?

    • @Carberra
      @Carberra  Před 6 měsíci

      There actually kinda of is! I talk about it more in this video: czcams.com/video/Wy4sI0zFXsU/video.html

  • @pedroivog.s.6870
    @pedroivog.s.6870 Před 9 měsíci +2

    Working at Python development and maintenance must be very interesting given how much they develop and optimize, besides eorking at other projects like their several libraries and frameworks

  • @kevin_mitchell
    @kevin_mitchell Před 9 měsíci +3

    Can't read and listen at the same time. Had to give up at 1:26. Of course I can pause it, but it's a constant occurrence and not an intermittent one, making it very difficult to follow along. Just my personal feedback and may not be applicable to most viewers who are already subscribers and like this format, so maybe this critique may not be relevant in informing the format of future video releases, or maybe it will, or maybe your other videos which I haven't seen yet are completely different. Either way, it's just my personal feedback and nothing more than that. Having said that, it's also most likely due to my lack of knowledge in understanding the content in the first place.

  • @Thiagola92
    @Thiagola92 Před 9 měsíci +1

    0:48 Okay, I'm old thank you

    • @asdfghyter
      @asdfghyter Před 9 měsíci +1

      no, he’s just super young. not even 30

    • @Carberra
      @Carberra  Před 9 měsíci +2

      I turned 25 in September!

  • @ChrisJones-hv7mo
    @ChrisJones-hv7mo Před 7 měsíci

    I would have thought "Comprehension inlining" (PEP 709) would have been worth a mention. Considerable performance improvement from what I understand.

    • @Carberra
      @Carberra  Před 7 měsíci +1

      It was in the original draft of the script but I ended up cutting it out. It is indeed a 2x speed improvement though, which is always great to see!

  • @Turplemaple6318
    @Turplemaple6318 Před 9 měsíci

    Just read about threads in operating system and found out python doesn't support true multithreading and next day this video popped out .

  • @LavaHotMan
    @LavaHotMan Před 9 měsíci

    "Which module will automatically select the best child watcher?"
    Me: wha, uh, hmm. Umm.

  • @JorgeEscobarMX
    @JorgeEscobarMX Před 6 měsíci

    I just tried sqlite3 CLI and it's kinda useful, but I rather just write an actual script.

    • @Carberra
      @Carberra  Před 6 měsíci

      It's great if you need to check something really quick for debugging, but yeah I agree I'd rather do a script for anything proper.

  • @thatstupiddoll
    @thatstupiddoll Před 9 měsíci

    utcnow bering removed is huge

  • @GeorgeNoiseless
    @GeorgeNoiseless Před 9 měsíci +2

    Nothing excites me like typing improvements in Python!
    Having taken but a quick peek at the somewhat hyped Mojo (aka Better Python for AI), most of its innovation seems to be in adding strong typing.
    P.S. I was actually guessing "pathlib" for the "os" question, so close...

    • @davidanalyst671
      @davidanalyst671 Před 9 měsíci +2

      you may need to get out more

    • @GeorgeNoiseless
      @GeorgeNoiseless Před 9 měsíci

      Well I suppose that could have been worded better: No improvement in Python excites me like a typing improvement.
      Yet it's still but a shadow of the pure unbridled ecstasy of _s t r o n g_ typing.
      @@davidanalyst671

    • @Carberra
      @Carberra  Před 9 měsíci

      The typing improvements are pretty awesome this time round, can't argue with that! And well, there's a reason I made them both options 😉

    • @pietraderdetective8953
      @pietraderdetective8953 Před 9 měsíci +1

      looking at Mojo syntax makes me want to stay away to be honest...gone are the clear readable Python syntax we know and love.
      but I'm sure Mojo is going be amazing for the correct audience.

  • @jabuci
    @jabuci Před 9 měsíci +12

    Biggest in 15 years? What a clickbait title! These are good, but most of them are not so exciting for the majority of Python programmers.

    • @cynical5062
      @cynical5062 Před 9 měsíci +3

      The f-string parsing changes are quite nice, and the performance increases are interesting! You clearly aren't looking close enough at the changes...

    • @jabuci
      @jabuci Před 9 měsíci

      @@cynical5062 Performance increase started in 3.11. Keep your f-strings simple unless you want your code hard to read.

    • @jma42
      @jma42 Před 9 měsíci +3

      either you are a web developer or a script kiddie

  • @temp911Luke
    @temp911Luke Před 9 měsíci +1

    After I installed 3.12 having 3.11 before nothing works anymore, libs are not detected and whats worse PIP isnt working either.
    Python devs doing this for so long and cant even create a working installation file that wouldnt create any problems !

    • @Carberra
      @Carberra  Před 9 měsíci +1

      I use pyenv and it works, so perhaps it's just an issue with the official installers.

    • @truthmatters7573
      @truthmatters7573 Před 9 měsíci +1

      possibly a PATH issue, and that may not be the fault of the devs.

    • @temp911Luke
      @temp911Luke Před 9 měsíci

      @@truthmatters7573Maybe but Im sure i ticked the PATH box when installing the app.

    • @truthmatters7573
      @truthmatters7573 Před 9 měsíci +2

      @@temp911Luke a lot of things could go wrong with the PATH. Depending on what terminal you use, there are various configuration files that can override the PATH as well.
      Have you sorted the issue by now or is it still broken? if not what OS are you on?

    • @temp911Luke
      @temp911Luke Před 9 měsíci

      @@truthmatters7573 Ive got win10. No, not sorted. Im using the latest ver 3.11.6 instead.

  • @davidanalyst671
    @davidanalyst671 Před 9 měsíci +2

    This is it. Its all downhill from here. C++ does an update on their standards every year, but nothing you use or understand has changed other than maybe some internet crap in the last 30 years of C++.

    • @cynical5062
      @cynical5062 Před 9 měsíci +4

      No? The C++ standards committee publishes new standards roughly every 3 years. They publish *drafts* fairly often, but those are NOT official standards.

    • @lorenzomonacelli
      @lorenzomonacelli Před 9 měsíci +3

      At least you can compile a 50 years old C code with the latest version of g++, good luck trying to run a 2 years old python code with the latest interpreter

    • @mrgalaxy396
      @mrgalaxy396 Před 9 měsíci

      Backwards compatibility is the whole shtick of C++ and the reason why it's such a complicated (although powerful) mess. You can do things ten different ways precisely to still support legacy features and code. You can compile ancient C++ just fine today, I am not so sure about Python.

  • @jcbritobr
    @jcbritobr Před 9 měsíci

    Cant read nothing 😂

  • @burakdemircan_
    @burakdemircan_ Před 9 měsíci

    I believe you can talk faster. Just concentrate!

  • @Luix
    @Luix Před 9 měsíci

    so this is bigger than 2 to 3

  • @PursuitOfMastery
    @PursuitOfMastery Před 9 měsíci +1

    You’re wasting so much screen real estate.. can barely read the writings

    • @Carberra
      @Carberra  Před 9 měsíci +2

      Honestly now you've pointed it out I agree with you. I'll make scale them up a little more going forward, thanks!

  • @BR-hi6yt
    @BR-hi6yt Před 9 měsíci +7

    I didn't understand a single thing. Python getting geeky and autistic by the day.

    • @pauldhartley
      @pauldhartley Před 9 měsíci

      My view exactly

    • @illegalsmirf
      @illegalsmirf Před 9 měsíci

      Python documentation has always been incomprehensible and unreadable (it is presented as if by a super-autistic person) so I'm not surprised.

  • @drewsarkisian9375
    @drewsarkisian9375 Před 9 měsíci +3

    Unfortunately you speak way too fast.

  • @1vEverybody
    @1vEverybody Před 9 měsíci +1

    Ahh yet another base env 🫠 one day all repo’s and api’s will catch up and we will have universal Python.