What's new in Python 3.13?

Поделиться
HTML-код
  • Опубликовано: 5 окт 2024

Комментарии • 101

  • @Carberra
    @Carberra  5 месяцев назад +7

    If you're looking for more juicy details about 3.13, including the GIL-less Python builds, check out my first look video! ruclips.net/video/e4HOCuJfbGY/видео.html
    Thanks for stopping by!

  • @Its2Reel4U
    @Its2Reel4U 5 месяцев назад +437

    Will version 3.14 run under the name Pi-thon?

    • @Carberra
      @Carberra  5 месяцев назад +31

      Doesn't look as though anyone has made any official references as yet! Surely they will at some point. We'll have to keep our eyes peeled!

    • @sujalgarewal2685
      @sujalgarewal2685 5 месяцев назад +11

      It will be Py-π

    • @Emayeah
      @Emayeah 5 месяцев назад +29

      ​@@sujalgarewal2685 nah more like π-thon

    • @atommax_1676
      @atommax_1676 5 месяцев назад +2

      Sounds like russian pronunciation

    • @DennisJ42
      @DennisJ42 5 месяцев назад

      Hah. I like it. (The pun I mean)

  • @lowkeygaming4716
    @lowkeygaming4716 Месяц назад +4

    The JIT is what excited me the most, once it's fully implement, other language won't smirk at Python devs saying that Python is so slow compared to other scripting language like node

  • @carlosmspk
    @carlosmspk 5 месяцев назад +39

    As someone who likes to split packages into a lot of files, the cyclical import update is amazing.

    • @Carberra
      @Carberra  5 месяцев назад +1

      Cyclical import update?

    • @carlosmspk
      @carlosmspk 5 месяцев назад +1

      @@Carberra Oh nevermind, it only impacts circular references for the purposes of type annotations (I meant circular, not cyclical btw). Seems circular imports are here to stay (which would make sense)

    • @Carberra
      @Carberra  5 месяцев назад +1

      I wasn't sure if you meant that or whether you'd come across something amazing I'd missed lmao. Yeah the lazy imports PEP (which wouldn't taken out circular imports for good) was rejected some time in 3.12's development, so yeah, they're here to stay unfortunately 😔

  • @kokop1107
    @kokop1107 4 месяца назад +8

    Ios being added BEFORE Android? Now that is funny to me lmao

  • @Anonymous-6598
    @Anonymous-6598 5 месяцев назад +44

    Finally support for IOS and Android

    • @vinylSummer
      @vinylSummer 5 месяцев назад +1

      I wonder how android apps like Pydroid work 🤔

    • @Anonymous-6598
      @Anonymous-6598 5 месяцев назад

      @@vinylSummer, same question

    • @vinylSummer
      @vinylSummer 5 месяцев назад

      @@Anonymous-6598 I googled it. There's a python-for-android lib that does some smart cross-compilation magic, so there's at least that

    • @No_True_Scotsman
      @No_True_Scotsman 5 месяцев назад +2

      What do they mean by that? There's going to be an interpreter app? Or a library to run python inside other apps?

    • @MangoNutella
      @MangoNutella 5 месяцев назад +2

      ​@@vinylSummer I think it's because Android is just a Linux distribution on which Python can be installed.

  • @TimSavage-drummer
    @TimSavage-drummer Месяц назад

    The annotation improvements are very welcome, been avoiding upgrading the annotation support in odin because of the strings. The annotation parser is already fairly complex.

  • @pythonwithjames
    @pythonwithjames 5 месяцев назад +11

    Nice one for this! Loved the work on Improved error messages.

    • @Carberra
      @Carberra  5 месяцев назад +1

      Yeah, lot of nice quality of life updates in errors for sure!

  • @c4llv07e
    @c4llv07e 5 месяцев назад +9

    XDG base directory support is my favourite one.

    • @Lizardboythelazy
      @Lizardboythelazy 5 месяцев назад +1

      Where is this? I don't see a mention of it in the release notes.

  • @RobertFletcherOBE
    @RobertFletcherOBE 3 дня назад

    Its wild how much work is going into type annotation. its becoming its own weird meta language. which probably isn't good

  • @tswdev
    @tswdev 4 месяца назад +1

    2:31 this seems like perhaps the most important new thing on 3.13, I didnt fully understand the description but if it is what I think it is, this fixes the biggest downside to Python when compared to other "more mature" languages. I put that in quotes because the import system in python is extremely immature and the biggest issue it caused was not being able to use types anywhere we would like because of the need for imports. Hacks had to be used, like a import guard for only importing a type at "type checking" time. Which is a PITA do maintain. Hopefully this fixes that

    • @Carberra
      @Carberra  4 месяца назад +1

      I don't believe this change will resolve that, if you mean what I think you mean. You'll still to import types, though there'll be less of a need to import types at runtime. Still won't nullify all the benefits of that though.

  • @WhiteDoppler
    @WhiteDoppler 5 месяцев назад +1

    Distributions of python 3.13 will come with an optional additional binary (python3.13t) where the GIL is disabled. It's a checkbox in the windows installer, but it's going to be up to package maintainers to figure out how to distribute on other platforms

    • @Carberra
      @Carberra  5 месяцев назад +1

      Indeed! I didn't include it in the video as I'd covered it before and there hasn't been any major updates since, but it looks to be coming along very nicely. Hopefully it's all ready to go for the final release!

  • @Elefantoche
    @Elefantoche 4 месяца назад

    The only feature after security patches in upcoming python versions is backwards compatibility, which seems to be missing since... always...

  • @codeguy7309
    @codeguy7309 5 месяцев назад +33

    now python is slower even faster

  • @AsgerJon
    @AsgerJon 5 месяцев назад +8

    lmao, how can the jit provide such a small improvement? I recall numba being like orders of magnitude faster.

    • @betterinbooks
      @betterinbooks 5 месяцев назад

      I also would like an explanation on this.

    • @ilikeshiba
      @ilikeshiba 5 месяцев назад +3

      Because it’s basically just like an inlined continuation passing style chained function call JIT. If your interpreter is well written and your language has fundamentally slow semantics (like python) you won’t see much gain from something like this.
      The reason JITs are fast is due to optimization and speculative optimization especially for dynamic languages. This style of JIT does neither. The generated code still treats every variable as what it is: a big dynamic blob of memory that you can’t assume much about. So basically we’re only seeing the time to find the next byte code instruction and some function call overhead within the interpreter optimized out.
      I’m very surprised to learn that this style of JIT is “new” though. Maybe it wasn’t formally described until 2021 but I’ve literally written (half of) a JIT for a toy gameboy emulator that works the exact same way because it’s so obvious and easy.

    • @AsgerJon
      @AsgerJon 5 месяцев назад

      @@ilikeshiba But numba-jit provides an improvement at like orders of magnitude, why does this jit give us only 10 % or whatever it was?

    • @ilikeshiba
      @ilikeshiba 5 месяцев назад

      @@AsgerJon I’m not personally familiar with it but from a quick glance at their website, numba is optimizing and using LLVM. It’s unclear if it’s doing any speculative optimization but even without speculative optimization, knowing the order of instructions would allow optimizations like reordering instructions, possibly vectorizing, reallocating registers to avoid register spills, removing duplicated work between bytecode instructions, and fusing instructions together in some cases. LLVM is much, much, much higher overhead in terms of code shipped and time spent compiling your code than the simple technique CPython is using.
      The main appeal of JITs like the one that CPython is shipping is that they’re simple and obviously correct and you’ll pretty much never spend more time running the JIT than you will gain by having done it.
      I think CPython is more concerned about strictly following the spec and being simple than being fast. Faster alternative compilers will still have a place for less conservative users that don’t mind more (potential) breakage or heavier python runtimes with more potential bugs for speed.
      But if it’s as fast as you say then they probably are able to, either speculatively or by changing the semantics of Python, optimize types into simpler ones that can be run quickly. I’m not 100% sure but I assume Int is an object on the heap that works as an arbitrary precision integer without any extra optimizations in CPython. In numba they probably give you access to either a fixed bitwidth number type implicitly or explicitly and can use that alone to get massive speed ups and even further optimizations that will just never be possible otherwise. It can change what would be multiple virtual function calls on an object on the heap doing lots of work into 1 or 2 machine instructions operating on a register.

    • @TheArtikae
      @TheArtikae 5 месяцев назад +1

      @@AsgerJon???? They explained exactly why in the comment you’re replying to.

  • @mihailyanchev1905
    @mihailyanchev1905 4 месяца назад

    Thanks for the useful info 🙏🏼

  • @rkdeshdeepak4131
    @rkdeshdeepak4131 5 месяцев назад +6

    On android , it already compiles on termux.

  • @alikhatami6610
    @alikhatami6610 4 месяца назад +4

    I didn't understand a thing! Am I that bad of a programmer ?

    • @kaiser2261
      @kaiser2261 4 месяца назад +1

      He went kind of fast but if you understood literally nothing I’d recommend reading one of the O Reilly Python textbooks.

  • @MrAlanCristhian
    @MrAlanCristhian 5 месяцев назад +3

    I want to know more about the new Incremental Garbage Collection

    • @Carberra
      @Carberra  5 месяцев назад +4

      It basically just collects small parts over time rather than the whole heap at once. I didn't include it in the video as I couldn't find any performance comparisons between the two systems.

    • @Danielm103
      @Danielm103 4 месяца назад +1

      I’m a bit worried about this. I’m writing wrappers for AutoCAD where the objects have an open-forread, open-forwrite, and closed state. As of now, GC is mostly deterministic and I rely on it’s current behavior

  • @lbgstzockt8493
    @lbgstzockt8493 5 месяцев назад +2

    I wish python would stop using global variables in function definitions unless explicitly told to, like in C++. I didn’t know it did this until it caused a really annoying to fix error for me, and just seems unintuitive.

  • @stevemorse5052
    @stevemorse5052 Месяц назад

    I liked the 'Hell yea'!

  • @jamesarthurkimbell
    @jamesarthurkimbell 5 месяцев назад

    The TypeIs/TypeGuard stuff feels like it should be a part of pattern matching

    • @Carberra
      @Carberra  5 месяцев назад +1

      You can actually use built-in functions like dict(), int() etc. to do that! (I think anyways, I've seen it, never tried it personally.)

    • @jamesarthurkimbell
      @jamesarthurkimbell 5 месяцев назад

      @@Carberra Yeah, I've done that. But I don't know if it helps type checkers narrow down their analysis as much as these tools (otherwise why would they exist?). Or maybe it's just people coming from TypeScript and wanting to do things a certain way

  • @unvergebeneid
    @unvergebeneid 4 месяца назад

    Solaris still exists?! 😄

  • @MasterSergius
    @MasterSergius 4 месяца назад

    Wait, we can't migrate to 3.12 because of dependencies and now you present 3.13?

  • @aristonsaizoxic1048
    @aristonsaizoxic1048 5 месяцев назад +4

    I wish pyscript would become mainstream.....i don't want to learn another language for front end.

    • @matis9783
      @matis9783 5 месяцев назад

      Xd

    • @ewerybody
      @ewerybody 5 месяцев назад

      what's a pyscript?

    • @yashdeveloper9449
      @yashdeveloper9449 5 месяцев назад

      ​@@ewerybodyjavascript but py

    • @Carberra
      @Carberra  5 месяцев назад +1

      I'm plugging myself a lot in the comments today apparently, but I made a video on PyScript if you want to know more: ruclips.net/video/VD2s23JgE7I/видео.html

    • @MrZmogZ
      @MrZmogZ 5 месяцев назад

      There is transcrypt

  • @hanyanglee9018
    @hanyanglee9018 4 месяца назад

    the future of python is tython, not multi threaded.

  • @JarppaGuru
    @JarppaGuru 5 месяцев назад

    dont know whats removed? lol 3.14 coming

  • @guilherme5094
    @guilherme5094 5 месяцев назад

    👍

  • @ivankramarenko
    @ivankramarenko 5 месяцев назад

    wthell 2k.... may be in 3k it will good(not)

  • @dwight4k
    @dwight4k 5 месяцев назад +1

    653 or 563?

    • @Carberra
      @Carberra  5 месяцев назад +2

      It is 563, sorry. I've watched this so many times and missed that! Thanks for pointing that out.

    • @dwight4k
      @dwight4k 5 месяцев назад +2

      @@Carberra No problem. Great video.

  • @seansingh4421
    @seansingh4421 4 месяца назад

    Ha Good luck ever running it properly now since the 24.04 LTS fckin broke pip.

    • @Carberra
      @Carberra  4 месяца назад

      Did it? How so?

    • @seansingh4421
      @seansingh4421 4 месяца назад

      @@Carberra pip install soandso used to work perfectly. Now its returns env and permission error for everything, on a local admin account 😑😑

    • @TedMan55
      @TedMan55 4 месяца назад

      @@seansingh4421curious to hear more about this, i just built a server running 24.04 and curious to hear how it went

  • @afterschool2594
    @afterschool2594 4 месяца назад

    Nah, I am waiting for πthon

  • @djtomoy
    @djtomoy 5 месяцев назад

    2.7 4 life

  • @pikadroo
    @pikadroo 5 месяцев назад

    Oh are you gonna tell us how all our code will break. Get off my feed!

  • @ButchCassidyAndSundanceKid
    @ButchCassidyAndSundanceKid 5 месяцев назад +4

    Get rid of the GIL !

    • @themartdog
      @themartdog 5 месяцев назад

      Isn't there a GIL-less build as of 3.12?

    • @Carberra
      @Carberra  5 месяцев назад +2

      If you're curious, there looks to be a label on GitHub specifically for this work: github.com/python/cpython/pulls?q=is%3Apr+label%3Atopic-free-threading+
      I didn't talk about it this time cos there wasn't really much to add over what I've discussed before, but it looks to be coming along rather well!

    • @Carberra
      @Carberra  5 месяцев назад +2

      @themartdog The 3.12 GIL-less build was an unofficial prototype, a proof-of-concept kinda thing. The 3.13 one is (planned to be) a much more feature-complete thing. I'm not quite sure how far along they are at the moment.

    • @jonragnarsson
      @jonragnarsson 5 месяцев назад +2

      What has Gil ever done to you?

    • @ButchCassidyAndSundanceKid
      @ButchCassidyAndSundanceKid 5 месяцев назад +2

      @@jonragnarsson You should rephrase what has GIL hasn't ever done to you.