Live data from Hacker News

Python 3.13.0 Is Released

docs.python.org

121–130 of 135 posts

Re: Python 3.13.0 Is Released

#121
post #61

Earlier quoted context omitted.

Can you please link me to a raised issue for this? This sounds concerning.

While this bug has been around longer than merely since 3.10, I am betting this is the one, based on the description of the issue: https://github.com/python/cpython/issues/84904 (Don't let the associates with asyncio throw you: that was merely the code in which it was first found; later code transcends it.)

not just this one, I've been tracking this too

https://github.com/python/cpython/issues/109534

Re: Python 3.13.0 Is Released

#122
post #60
post #54

Python version from 3.10 have had a very annoying bug with the SSLContext (something related only to glibc) where there are memory leaks when opening new connections to new hosts and eventually causes any service (dockerized in my case) to crash due to OOM. Can still see that the issues have not been resolved in this release which basically makes it very difficult to deploy any production grade service difficult.

Maybe related to this segfault I found on MacOS? https://github.com/python/cpython/issues/114653

I've been tracking this one: https://github.com/python/cpython/issues/109534, but there are multiple others raised in the cpython repo over on Github. Searching for asyncio or sslcontext shows multiple issues raised over the years with no fix in place.

Re: Python 3.13.0 Is Released

#123

What I've been surprised about is the number of python packages that require specific python versions(e.g., works on 3.10, but not 3.11. Package versioning is already touchy enough without the language itself causing it in minor upgrades. And will python 3.14 be named pi-thon 3.14. I will see myself out.

Today someone's pipeline broke because they were using python:3 from Dockerhub and got an unexpected upgrade ;-)

Specifically, pendulum hasn't released a wheel yet for 3.13 so it tried to build from source but it uses Rust and the Python docker image obviously doesn't have Rust installed.

Re: Python 3.13.0 Is Released

#124

Earlier quoted context omitted.

My code isn't dependant on multi-threading at all. It use fork in Python multiprocess, because many packages can't be "pickled" (the standard way of copying data structures between processes), so instead my code looks like: * Set up big complicated data-structures. * Use fork to make a bunch of copies of my running program, and all my datastructures * Use multiprocessing to make all those python programs talk to each…

'Threading' is an overload term. And while I didn't know, I was wondering if at the library level, the fact that posix_spawn() pauses the parent, while fork() doesn't, that is what you were leveraging. The python multiprocessing module has been problematic for a while, as the platform abstractions are leaky and to be honest the POSIX version of spawn() was poorly implemented and mostly copied the limits of Windows. I…

I found where subprocess moved to posix_spawn() that may help.

https://bugs.python.org/issue35537

My guess is that threads in Cython are an end goal. While setting execution context will get you past this release, fork() has to be removed if the core interpreter is threaded.

The delta between threads and fork/exec has narrowed.

While I don't know if that is even an option for you, I am not seeing any real credible use cases documented to ensure that model is supported.

Note, I fully admit this is my own limits of imagination. I am 100% sure there are valid reasons to use fork() styles.

Someone just needs to document them and convince someone to refactor the module.

But as it is not compatible with threads, has a ton of undefined behavior and security issues, fork() will be removed without credible documented use cases that people can weigh when considering the tradeoffs.

Re: Python 3.13.0 Is Released

#125

Earlier quoted context omitted.

Beartype is incredible. It is soo fast I put it as decorator on all functions of all my projects. It's day and night compared to typeguard. Also the dev is... Completely out of this world

I don't get the point of a runtime type checker. It adds a lot of noise with those decorators everywhere and you need to call each section of the code to get full coverage, meaning 100% test coverage. At that point just use rust, or am I missing something?

It looks like you call a function near the beginning of your Python program / application that does all the type checking at startup time. IDK for sure, I haven't used the library.

Someone using Python doesn't "just use Rust", there are very clear pros and cons and people already using Python are doing so for a reason. It is sometimes helpful to have type checks in Python though.

Re: Python 3.13.0 Is Released

#126

Earlier quoted context omitted.

I don't get the point of a runtime type checker. It adds a lot of noise with those decorators everywhere and you need to call each section of the code to get full coverage, meaning 100% test coverage. At that point just use rust, or am I missing something?

It looks like you call a function near the beginning of your Python program / application that does all the type checking at startup time. IDK for sure, I haven't used the library. Someone using Python doesn't "just use Rust", there are very clear pros and cons and people already using Python are doing so for a reason. It is sometimes helpful to have type checks in Python though.

From the doc it does not seem to be the case.

> Use beartype to assure the quality of Python code beyond what tests alone can assure. If you have yet to test, do that first with a pytest-based test suite, tox configuration, and continuous integration (CI). If you have any time, money, or motivation left, annotate callables and classes with PEP-compliant type hints and decorate those callables and classes with the @beartype.beartype decorator.

Don't get me wrong, I think static type checking is great. Now if you need to add a decorator on top of each class and function AND maintain 100% code coverage, well that does not sound like "zero-cost" to me. I can hardly think of a greater cost just to continue dynamically typing your code and maintain guarantees about external dependencies with no type hints.

Re: Python 3.13.0 Is Released

#127
post #66

Earlier quoted context omitted.

I've love to see a revamp of the import system. It is a continuous source of pain points when I write Python. Circular imports all over unless I structure my program explicitly with this in mind. Using python path hacks with `sys` etc to go up a directory too.

The biggest problem with Python imports is that the resolution of non-relative module names always prioritizes local files, even when the import happens in stdlib. This means that, for any `foo` that is a module name in stdlib, having foo.py in your code can break arbitrary modules in stdlib. For example, this breaks: # bisect.py ... # main.py import random with: Traceback (most recent call last): File ".../foo.py",…

That's not a problem, let alone the biggest one. You should just use relative imports explicitly.

Re: Python 3.13.0 Is Released

#128
post #4

Python versions 3.11, 3.12 and now 3.13 have contained far fewer additions to the language than earlier 3.x versions. Instead the newest releases have been focusing on implementation improvements - and in 3.13, the new REPL, experimental JIT & GIL-free options all sound great! The language itself is (more than) complex enough already - I hope this focus on implementation quality continues.

I've love to see a revamp of the import system. It is a continuous source of pain points when I write Python. Circular imports all over unless I structure my program explicitly with this in mind. Using python path hacks with `sys` etc to go up a directory too.

Getting a cyclic import error is not a bug, it's a feature alerting you that your code structure is like spaghetti and you should refactor it to break the cycles.

Re: Python 3.13.0 Is Released

#129
post #66

Earlier quoted context omitted.

The biggest problem with Python imports is that the resolution of non-relative module names always prioritizes local files, even when the import happens in stdlib. This means that, for any `foo` that is a module name in stdlib, having foo.py in your code can break arbitrary modules in stdlib. For example, this breaks: # bisect.py ... # main.py import random with: Traceback (most recent call last): File ".../foo.py",…

That's not a problem, let alone the biggest one. You should just use relative imports explicitly.

It is a problem because stdlib does not use relative imports for other stdlib modules, and neither do most third-party packages, which then breaks you regardless of what you do in your code.

Re: Python 3.13.0 Is Released

#130
post #66

Earlier quoted context omitted.

The biggest problem with Python imports is that the resolution of non-relative module names always prioritizes local files, even when the import happens in stdlib. This means that, for any `foo` that is a module name in stdlib, having foo.py in your code can break arbitrary modules in stdlib. For example, this breaks: # bisect.py ... # main.py import random with: Traceback (most recent call last): File ".../foo.py",…

I agree, it's unreasonable to expect devs to know the whole standard library. The VSCode extension Pylance does give a warning when this happens. I thought linters might also check this. The one I use doesn't, maybe the issue[0] I just created will lead to it being implemented. [0]: https://github.com/astral-sh/ruff/issues/13676

One of the changes in Python 3.13 is that it'll warn you when that is the likely cause of breakage and explain how to fix it: https://docs.python.org/3.13/whatsnew/3.13.html#improved-err...

But the problem remains, because these warnings - whether they come from linters or Python itself - can only warn you about existing stdlib modules. I'm not aware of any way to guard against conflicts with any future new stdlib modules being added.

Post reply on HN