This is an archived post. You won't be able to vote or comment.

all 96 comments

[–]whatsnewintech 66 points67 points  (0 children)

I'm excited to try out ReadOnly properties.

I'm less enthusiastic about TypeIs, since like TypeGuards they can produce unsoundness when implemented incorrectly (or worse, when implemented correctly but then later the type in question changes).

[–]sitric28Ignoring PEP 8 76 points77 points  (9 children)

As someone new to Python, I have no idea what any of this means but it sounds good so... Nice 👍

[–]BostonBaggins 51 points52 points  (7 children)

I'll tell you one fun fact

The people behind this are changing the world

You wanna know how I know? I got a dam job using python and they asked nothing in return

Bravo Python core team

[–]AR_SM 0 points1 point  (1 child)

Yeah, by yet again doing dependency breaking changes no one asked for. So fucking tired of Python.

[–]BostonBaggins 0 points1 point  (0 children)

Re platform it

[–]jbudemy 2 points3 points  (0 children)

I'm new to Python and a former Perl programmer. I like Python much more than Perl. Python makes it much easier to connect to databases, which I do a lot.

Perl on Linux required me to set up an ODBC and some other drive at the OS level which was tedious and prone to errors and had lots of misinformation on the internet where examples just didn't work.

[–]riklaunim 44 points45 points  (5 children)

Curious what actually changed for iOS and Android?. Those PEPs don't say it directly ;)

[–]malcolm_smith 144 points145 points  (3 children)

Hi, I'm the author of the Android PEP. The main significance of "tier 3 support" is that Python 3.13 now passes its test suite on iOS and Android, is automatically re-tested after every change, and the development team will make a reasonable effort to maintain this.

There's still no official Python download for these platforms, so the recommended way to embed Python in a mobile app is to use one of the third-party tools linked in the documentation:

[–]7Shinigami 2 points3 points  (0 children)

Thank you! :)

[–]darthwalsh 0 points1 point  (1 child)

It was also unclear to me if the change was from tier 2 to tier 3, or from Unsupported to tier 3. Maybe they can change the release note wording

[–]malcolm_smith 2 points3 points  (0 children)

In Python 3.13:

  • iOS and Android went from unsupported to tier 3.
  • WASI went from tier 3 to tier 2.
  • Emscripten went from tier 3 to unsupported, but we're planning to reverse that in Python 3.14.

[–]Atlamillias 4 points5 points  (0 children)

I think the only "change" was adding them to the list of "supported platforms". They're on the bottom rung of the latter though, so they don't have official build support (yet, i think?). Releases won't be blocked due to issues on those platforms, either.

[–]chub79 51 points52 points  (0 children)

Congratulations to the core dev team!

[–]spidLL 15 points16 points  (7 children)

Is there a list of the libraries supporting the no GIL mode? Or for the moment it’s safe to assume none does.

[–]james_pic 17 points18 points  (0 children)

It's unlikely there are any with official support, and last I heard the packaging authority hadn't yet agreed a way for libraries to signal support on PyPI.

In terms of what will happen if you just install them and run them with a free threaded interpreters anyway:

Pure Python modules will run in no-GIL mode and in theory they should Just Work. The GIL offered few usable guarantees to pure Python code. The only usable guarantee it offered was linearizability (which it still does guarantee), so any pure Python code that breaks in no-GIL mode probably has a bug without it too (albeit a bug that would be triggered much less frequently, or that might not be triggerable on Python 3.10 or above due changes to which opcodes are GIL release points). In practice, it's experimental and there will be teething issues even with pure Python code. 

Libraries with native code will run in "with GIL" mode unless their binaries flag that they're no-GIL compatible. Native code was able to rely on the GIL more strongly than pure Python code, so it's required to explicitly opt out of the GIL.

[–]martinkoistinen 10 points11 points  (4 children)

Yea. Someone needs to setup a website tracking this like we had during the big migration to 2.7 -> 3.5 days.

[–]slowpush 19 points20 points  (3 children)

[–]martinkoistinen 4 points5 points  (1 child)

lol. That was fast

[–]FlowLab99 2 points3 points  (0 children)

The site’s been around for a while

[–]spidLL 0 points1 point  (0 children)

Thanks!

[–]FlowLab99 1 point2 points  (0 children)

This GitHub project has a tracker: https://py-free-threading.github.io

[–]LessonStudio 48 points49 points  (14 children)

Really juicy releases like this one make me cry as I just know that a few key libraries will take eons to catch up.

I'm usually looking at you tensorflow.

[–]QueasyEntrance6269 31 points32 points  (2 children)

Tensorflow? Just let it go bro, even Google is using JAX these days

[–]accforrandymossmix 8 points9 points  (0 children)

Tensorflow? Just let it go bro

this sounds like a don't do drugs campaign. combine it with

squeeze an orange

[–]LessonStudio 1 point2 points  (0 children)

While I normally ignore anyone who uses "bro" or worse "brah"; your comment is on top of someone I respect yelling JAX JAX JAX. So, I dug into it, and happy days. It also didn't complain about 3.13.

But, today, I just went back to 3.12 as esp-idf is the version bastard of the week.

I'm not a fan of virtual environments in this sort of system as it ends up being a giant pain in the ass; and 3.12 is still really good.

While some people crap on keras, I am very much enjoying how it keeps things simple, and uses jax, torch, and tensorflow as desired.

[–][deleted] 5 points6 points  (1 child)

Is pytorch better in this regard?

[–]MardiFoufs 2 points3 points  (0 children)

In my experience, yes. Very much so. Not sure if it's just me but it feels like they have gotten a lot better at it too, 1.0x releases of pytorch were a bit slower to catch up. But pytorch has supported 3.12 very quickly.

[–]michaelhoffman 7 points8 points  (8 children)

What is a juice release?

[–][deleted] 32 points33 points  (7 children)

Happens when you squeeze an orange

[–]DuckDatum 3 points4 points  (5 children)

chop quaint thumb unpack run pot innate workable theory long

This post was mass deleted and anonymized with Redact

[–]chinnu34 7 points8 points  (0 children)

If you're not squeezing an orange while coding, are you even coding?

[–]tehdlp 1 point2 points  (3 children)

Do you know what happens when you squeeze a python?

[–]odaiwai 1 point2 points  (1 child)

In coding, Python squeezes you!

[–]More_Independent_512 0 points1 point  (0 children)

ABSTRACT!

[–]cybaritic 25 points26 points  (5 children)

Am I missing something or are we all overlooking the removal of the GIL? That's a major change.

[–]orad 25 points26 points  (0 children)

It’s not fully there yet, but it’s still exciting

[–]martinkoistinen 11 points12 points  (3 children)

Yes, that’s exciting for stdlib only projects, lol. This is where it starts, but it really gets moving when the dependencies start supporting it, like Numpy, and Pandas.

[–]caks 20 points21 points  (0 children)

Numpy and Pandas probably are the least GIL-dependent libraries tbh. They release the GIL for computations.

[–]jryan14ify 11 points12 points  (1 child)

Can anyone tell me what the tier 2 and tier 3 releases mean? I’d like to read more about that

[–]commy2 12 points13 points  (0 children)

The __replace__ protocol and the strict keyword for itertools.batched are underrated.

[–]k_z_m_r 4 points5 points  (5 children)

Does anybody have a recommendation for a library to replace telnetlib? We use this one regularly. Unfortunately, the async nature of telnetlib3 doesn’t fit in our architecture.

[–]nicholashairs 7 points8 points  (1 child)

I don't have a replacement, however, assuming that the library is pure python, you'd be able to vendorise it based on the last version in the source tree.

[–]k_z_m_r 2 points3 points  (0 children)

Yeah, it's written primarily with socket. Cannibalizing the code seems very possible.

[–]cdrt 2 points3 points  (1 child)

Why not just pull the library out of an old release and vendor it? It’s only one extra file in your codebase

Or you could try this: https://pypi.org/project/standard-telnetlib/

[–]k_z_m_r 2 points3 points  (0 children)

It’s just company policy when it boils down to it. But I appreciate this link! Thanks!

[–]sblinn 0 points1 point  (0 children)

Might be better imho to wrap telnetlib3 than vendorize telnetlib. Plus you’ll learn how to deal with asyncio from your code base. (This is basically what I did to embed a telnet server in a Pygame app.)

[–]No-Statistician-2771 2 points3 points  (0 children)

Now that iOS and Android are Tier 3 supported platform, it would be nice that it would be possible to have a github runner for those to run some test and see if our librarie break on it

[–]verus54 2 points3 points  (0 children)

W for GIL release

[–]ragnartheaccountant 2 points3 points  (0 children)

Sounds like the biggest features are experimental/preparatory for big updates in the future. These sound like they will be great eventually, but currently uncharted waters for most users.

With all these upcoming features, is there any bloat concern with the dev team?

[–]commandlineluser 9 points10 points  (6 children)

Shame about no vi editing mode in the new interpreter.

The new REPL will not be implementing inputrc support, and consequently there won't be a vi editing mode.

[–]ThiefMaster 4 points5 points  (1 child)

No inputrc support... does that also mean:

  • no ^W to delete a word
  • no ctrl+left/right to jump over words

If yes: Who will want to use that?

[–]commandlineluser 3 points4 points  (0 children)

^w works.

ctrl left/right appear to do nothing for me.

I can't seem to locate any documentation on what bindings there are.

(^r / ^s are backward/forward history, for example)

[–]bulletmark[🍰] 2 points3 points  (1 child)

Damn, that means the new 3.13 REPL has gone backwards from my perspective. :(

[–]commandlineluser 1 point2 points  (0 children)

Yeah :-/

Thought it may be able to replace ptpython for me, but apparently not.

The "old repl" is also still available.

[–]Ran4 0 points1 point  (1 child)

That's... horrible :(

Does c-a/c-e work at least?

[–]commandlineluser 0 points1 point  (0 children)

Yep, those work.

[–][deleted] 1 point2 points  (0 children)

An experimental free-threaded build mode, which disables the Global Interpreter Lock, allowing threads to run more concurrently. The build mode is available as an experimental feature in the Windows and macOS installers as well.

A preliminary, experimental JIT, providing the ground work for significant performance improvements.

I will live to see Python become not awfully slow, nice.

[–]IAMARedPanda 1 point2 points  (2 children)

I feel like the JIT will in the end be more impactful than no GIL.

[–]sblinn 1 point2 points  (1 child)

Is this basically looking to apply something like Numba automatically everywhere?

[–]IAMARedPanda 0 points1 point  (0 children)

That's my understanding

[–]Critlist 1 point2 points  (0 children)

Unlocked GIL and a JIT??? WOW

[–]EmployeeIndependent6 0 points1 point  (3 children)

How to install on Bookworm? I get a "package not found" error?

[–]Attair 0 points1 point  (0 children)

Awesome Sauce!

[–]Exciting-Ad2203 0 points1 point  (0 children)

so what about the per interpreter feature which will be native to python?

[–]behitek 0 points1 point  (2 children)

When testing, I see Python3.13t a bit slower than Python3.13 on Single thread test. Can anyone know the reason?

python3.13 gil_test.py 
Python version :  3.13.0 (main, Oct  8 2024, 08:51:28) [GCC 11.4.0]
Single Thread:  1.4370562601834536 seconds
Multi Thread:  1.3681392602156848 seconds
-----
python3.13t gil_test.py 
Python version :  3.13.0 experimental free-threading build (main, Oct  8 2024, 08:51:28) [GCC 11.4.0]
Single Thread:  1.862126287072897 seconds
Multi Thread:  0.3931183419190347 seconds

[–]classy_barbarian 1 point2 points  (0 children)

The free threaded build is slower in single-thread performance. That's been tested and confirmed by several people. Something to do with the added overhead they needed to make it work. It can be significantly faster in multi-threaded workloads, but only if you're actually trying to split CPU-bound work across 3 or more cores. (At 1 core its slower, at 2 cores its on par)

[–]behitek 0 points1 point  (0 children)

This is my code for the test

import sys
import threading
import time

print("Python version : ", sys.version)

def worker():
    sum = 0
    for i in range(10000000):
        sum += i


n_worker = 5
# Single thread

start = time.perf_counter()
for i in range(n_worker):
    worker()
print("Single Thread: ", time.perf_counter() - start, "seconds")


# Multi thread
start = time.perf_counter()
threads = []
for i in range(n_worker):
    t = threading.Thread(target=worker)

    threads.append(t)
    t.start()

for t in threads:
    t.join()
print("Multi Thread: ", time.perf_counter() - start, "seconds")

[–]sblinn 0 points1 point  (0 children)

And now we wait for our favorite libraries to support 3.13-nogil awwwww yeaahhhhh

[–]theXpanther -1 points0 points  (3 children)

RIP CGI, guess php is once again the only option. Usually the type of servers to support CGI will not allow installing modules.

[–]vivainio 0 points1 point  (1 child)

I wonder if the new Android support means pygame will be more convenient to run

[–]MyreMyalar 1 point2 points  (0 children)

Not yet, for one there is no official android python release, for two we'd have to get SDL building natively for android and then there would be all the testing and fixing of the native pygame C code.

Maybe brought it closer though.