Python 3.13.0 (final) has been released (discuss.python.org)
from norambna@programming.dev to python@programming.dev on 07 Oct 2024 17:22
https://programming.dev/post/20298150

#python

threaded - newest

gigachad@sh.itjust.works on 07 Oct 2024 19:03 next collapse

Nice I guess it’s time to check if my daily used libraries have stable 3.12 releases already.

I guess the free-threaded mode and the JIT compiler will be the most important features from what I read, but their significance is out of my expertise.

My absolute favorite with this update is the new REPL! It features Multiline-editing and a paste mode for easier pasting code. It also added the spaces automatically in my example.

<img alt="" src="https://sh.itjust.works/pictrs/image/ad0fb46e-6cbc-4ec5-8dfc-d2e76d343e62.png">

Sometimes I want to make some quick tests on some data in the terminal without installing IPython to my environment first, this is great news!

This new error message will also be very useful for beginners and relieve StackOverflow:

AttributeError: module 'numpy' has no attribute 'array' (consider renaming '/home/me/numpy.py' if it has the same name as a third-party module you intended to import)

mamg22@sh.itjust.works on 08 Oct 2024 14:38 collapse

That last one is going to be so good. Months ago I ran into that while porting the “Crafting Interpreters” java-based interpreter into python. It took me a few hours to figure out that one of my modules was colliding with “token” in the stdlib, a module I didn’t even know existed. Glad it’s being made clearer.

[deleted] on 07 Oct 2024 19:05 next collapse
.
FizzyOrange@programming.dev on 07 Oct 2024 19:49 next collapse

Wow, they (apparently) finally made the REPL not suck! I always thought it was weird how shit it was given that it’s one of the big reasons Python has become as popular as it is.

Maybe in another 20 years they can make the package tooling not suck too.

solrize@lemmy.world on 07 Oct 2024 22:41 next collapse

The Python REPL was always sort of minimal when used from the command line, but is quite usable in an Emacs window. IDLE is also useful some of the time. I never felt the need for anything like Eclipse because of it.

sugar_in_your_tea@sh.itjust.works on 07 Oct 2024 23:16 next collapse

poetry has made the package tooling generally not suck for me, and uv seems to be getting better. Just a few more PEPs to go until uv does what I want. Here’s hoping.

humble_pete_digger@lemm.ee on 09 Oct 2024 10:03 collapse

Poetry is frigging great.
Never heard of uv.

sugar_in_your_tea@sh.itjust.works on 09 Oct 2024 15:36 collapse

uv is basically a super fast Python tool, written in Rust. Looks promising, but it seems to be missing some features I really like from Poetry, but I’m keeping my eye on it.

brettvitaz@programming.dev on 08 Oct 2024 00:56 next collapse

Maybe because people who needed it knew there were better ways to do it, like ipython and Jupyter. I’ve never heard of anyone gushing about the stock REPL.

Midnitte@beehaw.org on 08 Oct 2024 08:26 collapse

Tbf, uv is trying to solve packaging now

FizzyOrange@programming.dev on 08 Oct 2024 10:59 collapse

Yeah it’s definitely a vast improvement on previous attempts (Poetry et al).

I dunno if it can be called solved until it’s officially sanctioned and installed by default though, and I don’t see that happening for a very long time.

humble_pete_digger@lemm.ee on 09 Oct 2024 10:09 collapse

How is it better than poetry?

Buttons@programming.dev on 09 Oct 2024 14:55 next collapse

I abandoned poetry after it was unable to install a specific version of pytorch I was using.

In pip I would do something like pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118, but IIRC poetry didn’t support the –index-url option.

FizzyOrange@programming.dev on 09 Oct 2024 19:34 collapse

It actually works. I tried poetry once and it failed to resolve some simple dependency specification.

Ok you can say it was a fluke bug but it didn’t inspire confidence.

uv is also freakishly fast. My venv setup times went from 57 seconds to 7 seconds. I seriously doubt Poetry can do that because it’s written in Python.

fubarx@lemmy.ml on 07 Oct 2024 19:57 next collapse

Now only have to wait for:

  • pyenv release
  • pycharm update (including terminal)
  • 3rd party libraries

to catch up…

SatouKazuma@programming.dev on 07 Oct 2024 23:05 next collapse

Wait how does one make enough money to afford the JetBrains suite? I just do everything in VSCode.

ArtVandelay@lemmy.world on 08 Oct 2024 01:03 next collapse

I use and enjoy VS codium as well, but PyCharm has a community edition that is free.

SatouKazuma@programming.dev on 08 Oct 2024 10:36 next collapse

Ah

NostraDavid@programming.dev on 09 Oct 2024 21:02 collapse

VSCodium doesn’t have the Python plugin, does it? It also misses the config sync when you’re logged in (IIRC). Not the worst to miss if you start out, but I’ll take it over having to track EVERYTHING in my code-workspace file.

faltryka@lemmy.world on 08 Oct 2024 11:22 collapse

I know some people who have their work pay for it. I pay for the all products pack and it decreases in cost each year until a certain point. Not sure if I’m on some extra discount or whatnot but I only pay $18/mo and it’s easily worth it.

SatouKazuma@programming.dev on 08 Oct 2024 12:56 next collapse

Oh if only I could get my work to pay for it. Unfortunately, I’m in a megacorp that would shove said request so far down into bureaucracy hell…

SatouKazuma@programming.dev on 08 Oct 2024 12:56 collapse

Is that on your personal machine, though?

faltryka@lemmy.world on 08 Oct 2024 13:41 collapse

I have the jetbrains toolbox on like 4 of my machines at this point and three are personal and one is work. It’s a great experience but I pay for it personally because I value it.

SatouKazuma@programming.dev on 08 Oct 2024 15:06 collapse

If I end up getting a promotion I’ll have to consider that. It’s just a lot of money for me right now, because my current employer doesn’t pay shit at my title/rank.

misk@sopuli.xyz on 08 Oct 2024 07:48 collapse

Once that happens it’ll be just couple of years until trickles down to corpo I work at :(

We got Python 3.10 in our Hadoop/Spark setup recently. I’m really enjoying those improved debug messages, man.

NostraDavid@programming.dev on 09 Oct 2024 21:11 collapse

Protip: pip install pyupgrade And then find . -name ‘*.py’ -not -path ‘*.tox*’ -print0 | xargs -0 pyupgrade --py310-plus in your repo to update what can be updated.

BTW, pyupgrade’s creator, asottile (that’s his name) also has an informative channel: Anthony Writes Code where he explains Python features, or goes into interesting bugs he ran into, etc. The good stuff.

misk@sopuli.xyz on 09 Oct 2024 21:20 collapse

You assume that I can access PIP on a big data cluster in a financial institution ;) Even updating packages there requires me to ask for a custom image. I’m a data analyst so I just transform and extract what I can in a way that reduces size of the output and do cool stuff on my machine that has Python 3.11 and access to validated PyPI mirror. ETL that happens entirely on the cluster needs to be so optimised that I don’t need anything fancy thankfully.

sugar_in_your_tea@sh.itjust.works on 07 Oct 2024 23:19 next collapse

Woo!

We’re still on 3.11, but it’s been some time since I last checked compatibility with the later releases. Good job everyone, I’m going to be playing with this over the next couple weeks to see if we can upgrade to it.

NostraDavid@programming.dev on 09 Oct 2024 21:08 next collapse

So I remember the plan to improve Python’s speed from 3.9 to 3.13… Has there been an updated plan since? I presume the JIT will likely be faster in 3.14 (it’;s already at parity - pretty impressive for a first release), but is there anything else planned?

coriza@lemmy.world on 09 Oct 2024 21:08 collapse

Docstrings now have their leading indentation stripped 

I foolish thought that it meant that finally python introduced a hassle free simple way to have indented triple-quoted literal strings. But no. It baffles me that you cannot have simple literal strings that are indented. This is specially annoying if you are using them as templates to output multiline text.