3 ms·
> Nobody was really concerned about the Python code This was the top comment when I added my original comment: "Fundamentally every single piece of python cod
by js2 3y ago
> Nobody was really concerned about the Python code
This was the top comment when I added my original comment:
"Fundamentally every single piece of python code ever written will have to stop and now worry about potential race conditions."
https://news.ycombinator.com/item?id=36644114 https://news.ycombinator.com/item?id=36644114
Most of the other comments here at the time were similarly from people who clearly hadn't read the PEP saying it would break all existing Python code.
So I did my best to represent the backwards compatibility section of the PEP. I told folks to go read it and linked to it. I cited the portion relevant to Python code. There were too many bullet points for the C-API, so I summarized it with the disclaimer "Updating C-API extensions is where the majority of work will be if the PEP is accepted."
I also read the PEP discussion thread where there was disagreement from Python maintainers on how much work would be required of C extension authors, but most of the folks stating it would be a lot of work hadn't seemed to actually have tried to port anything to the new API. Meanwhile Sam had asserted that:
> Most C API extensions don’t require any changes, and for those that do require changes, the changes are small. For example, for “nogil” Python I’m providing binary wheels for ~35 extensions that are slow or difficult to build from source and only about seven projects required code changes (PyTorch, pybind11, Cython, numpy, scikit-learn, viztracer, pyo3). For four of those projects, the code changes have already been contributed and adopted upstream. For comparison, many of those same projects also frequently require changes to support minor releases of CPython.
I don't think I've misrepresented anything.
> No-GIL ain't done until all the C extensions run, especially NumPy.
Sam already got NumPy working without the gil:
https://youtu.be/9OOJcTp8dqE?t=1958 https://youtu.be/9OOJcTp8dqE?t=1958