#cpython — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #cpython, aggregated by home.social.
-
@mgorny You're welcome?
We don't usually do RCs for patch releases, the last one was five years ago. The 3.14.5 RC was specifically for the GC change.
Unfortunately timelines were a bit short because I wanted to get this out, but it took a bit of time to prepare and test the patches and I didn't want to rush that, nor release during PyCon US.
https://discuss.python.org/t/reverting-the-incremental-gc-in-python-3-14-and-3-15/107014
#Python #CPython -
Always appreciate how people release RCs to give others opportunity to test their changes early, then release final versions before the fixes for "breaks #Portage" kind of regressions introduced in the RCs are merged.
-
Inspired by @hugovk 's Bluesky Python core devs starter pack, I created one for Mastodon(.social): https://mastodon.social/collections/116540107831540575
A very new feature, and as such quite limited. If I've missed anyone on mastodon.social please let me know! If you're on another instance, I'm afraid I can't add you yet :'-(
-
Как устроен словарь в CPython: compact dict, key sharing и что с ним делает free-threading
У dict в Python слишком простая внешность: положили ключ, достали значение, пошли дальше. Но за этим стоит один из самых вылизанных участков CPython — с компактным хранением, сохранением порядка вставки, общими ключами для экземпляров классов, оптимизациями доступа к атрибутам и новыми компромиссами из-за free-threading. В статье разберём, почему обычный словарь давно перестал быть «просто хеш-таблицей», как его устройство влияет на память и скорость кода, и какие привычки Python-разработчика могут незаметно ломать быстрый путь интерпретатора. Разобрать dict
https://habr.com/ru/companies/otus/articles/1029210/
#python #CPython #словарь_Python #хештаблица #compact_dict #оптимизация_памяти
-
Me (yesterday): I'll just tidy up the way the inspect module's CLI reports objects from modules with no source code available (as cryptic tracebacks are not a friendly outcome)
Me (today): oh, wow, we did NOT consider how this interface would behave when the given object reference is an alias rather than the actual defining location for that object (it lies, oh how it lies) -
Nuitka 4.0: как я разогнал свой Python-скрипт на 335% и почему JIT-будущее уже на пороге
Представьте себе: вы запускаете свой старый добрый Python-скрипт, он привычно задумывается на пару секунд, а потом начинает работать. А теперь представьте, что тот же самый скрипт без единого изменения в коде — просто после прогона через одну утилиту — стартует почти мгновенно и работает втрое быстрее. Никакой магии, просто вышел Nuitka 4.0. 22 апреля 2026 года проект, который когда-то начинался как нишевый компилятор, дорос до мажорной версии 4.0. И это не просто «пофиксили баги, добавили пару флагов» — это реально меняет правила игры для тех, кто пишет на Python и хочет, чтобы код летал, а не ползал. По данным официальных тестов, скомпилированные скрипты показывают повышение производительности на 335% в pystone-бенчмарке по сравнению с CPython. Можете представить, что ваш веб-парсер или ML-пайплайн ускоряется втрое без переписывания на Rust. Если совсем просто: PyInstaller просто пакует ваш скрипт вместе с интерпретатором в один файл — по сути, это архив с «батарейками». А Nuitka переписывает весь Python-код на чистый C и компилирует его в настоящий исполняемый файл. Никакой интерпретации на лету — только скомпилированный бинарник, который в теории может обогнать даже PyPy. И теперь, с версией 4.0, эта теория стала куда ближе к практике. «Раньше я думал, что ускорение от Nuitka довольно скромное... но с версией 4.0 вижу реальный прогресс», — примерно так звучат комментарии на Hacker News , и я с ними согласен.
-
😂 Look, someone created a #dynamic #language called "Zef" (because why not?) and now believes they can compete with #Lua, #QuickJS, and #CPython. 🚀 Just another wild ride through "how to optimize your #hobby #project to do something totally unnecessary" land! 🛠️
https://zef-lang.dev/implementation #Zef #HackerNews #ngated -
RE: https://fosstodon.org/@savannah/116416941269710052
This is really good! There's a lot going on in CPython, here's just a few highlights.
#Python #CPython #CoreDispatch -
I also built `ft-review-toolkit` (using ThreadSanitizer) to check for free-threading readiness, which has found real data races in 12 extensions so far.
If you maintain a Python C extension and want a high-quality, human-reviewed bug report (or help migrating to free-threading), just let me know!
All the toolkits are open source:
https://github.com/devdanzin/cext-review-toolkit
https://github.com/devdanzin/ft-review-toolkit -
The results so far? Fixes merged in 14 projects!
Massive shoutout to the maintainers of simplejson, Cython, memray, h5py, greenlet, bottleneck, guppy3, bitarray, igraph, APSW, Pillow, regex, and many others!
The feedback they gave me, especially when pointing out my tool's false positives, was invaluable for making the scanners better.
It's been incredibly rewarding to see the tools find interesting bugs and watch the community merge the fixes so quickly.
#Python #CPython -
Historically, automated bug-finding tools have a bad habit of producing high-noise findings (and now worse: convincing AI slop) that just wastes maintainer time.
I built `cext-review-toolkit` using multiple specialized agents to find bugs, and I try to reproduce every finding from pure Python before reporting it.
Human review + pure-Python reproducers act as a necessary filter against false positives.
-
Systematically reviewing Python C extensions (575+ bugs found so far) and offering to analyze yours!
I’ve recently analyzed 44 C extensions for correctness and free-threading readiness. I'd love to run the analysis on your extension too.
If you want the deep dive into the methodology, the false positive rates, and what I've learned, I wrote a full post here: https://discuss.python.org/t/systematically-finding-bugs-in-python-c-extensions-575-confirmed-so-far/106875
But if you just want your C extension checked, reply below or DM me!
#Python #CPython -
Please welcome Stan Ulbrych @stanfromireland as the newest member of the Python core team!
https://discuss.python.org/t/vote-to-promote-stan-ulbrych/106562
-
I've created a CPython umbrella issue for C bugs found with a new tool: https://github.com/python/cpython/issues/146102
The umbrella issue reported 47 bugs, 18 have been filed by various people, and 14 have been fixed. Each bug has an explanation about it linked in the issue.
That means you can join the fun: pick a bug, create an issue, and fix it in a PR!
There's also a different umbrella issue with more than a hundred (less detailed) bugs to pick from: https://github.com/python/cpython/issues/146103
Have fun!
-
I was already having misgivings about #CPython when I saw a required #Rust dependency coming up (although I know many here have no issues with this), but now that there have been #LLM commits to the project, I'd like to look at alternatives. It seems great that #Pypy exists, although I worry that it will end up replicating undesirable behavior from CPython in the future.
I had been learning C++ with the goal of writing extensions using CPython. As it happens, I already have a physical copy of a book on #Lua and many applications are written in C++ with Lua scripting on top, so I'm going to swap out Python for Lua in an upcoming project. I'm excited to be able to experiment with #LuaLaTeX or writing scripts for #GeanyIDE. The language shows up in way more places than I realized.
#Python #cpp #CPlusPlus #programming #Scripting #ScriptingLanguage #TexLatex
-
GIL в Python для senior interview
GIL — самая известная «фича» Python, о которой большинство разработчиков знают ровно одну фразу: «мешает многопоточности». Этого хватает для джуна, но не для сеньора. Статья построена так, чтобы после её прочтения вы могли не только ответить на вопросы по GIL на senior-интервью, но и объяснить коллеге-стажеру, что происходит внутри интерпретатора, когда два потока пытаются одновременно изменить один список.
-
A GIL finalmente saiu do caminho.
O Python 3.14 torna a build free-threaded oficialmente suportada — não mais experimental. Threads CPU-bound que antes brigavam pelo mesmo core agora escalam de verdade.
Escrevi sobre o que muda na prática, como instalar em cada distro e o que você não pode mais assumir sobre thread safety:
https://www.riverfount.dev.br/posts/python_314_free_threading/
-
New season, new blogpost about our FLOSS contributions. Among them, a very old PR finally got merged into #cpython. That was the 27th oldest one.
https://yaal.coop/blog/en/dernieres-contributions-logiciels-libres-hiver-2026 -
Nouvelle saison, nouvel article de blog sur nos contributions à des logiciels libres. Notamment, une très vieille contribution de l'équipe a finalement été acceptée dans #cpython. C'était jusqu'alors la 27ème plus vieille PR du projet.
https://yaal.coop/blog/dernieres-contributions-logiciels-libres-hiver-2026 -
Как устроены память и Garbage Collector в CPython: разбор для Python backend interview
В Python памятью управляет не только Garbage Collector. На самом деле основа всего — reference counting , а GC лишь помогает собирать циклические ссылки. В этой статье разберём, как на самом деле устроено управление памятью в CPython : — что находится внутри PyObject — как работает ob_refcnt — почему одного reference counting недостаточно — как GC ищет циклический мусор — какие объекты вообще участвуют в сборке — и как всё это помогает искать memory leak в production Если ты готовишься к senior Python интервью или просто хочешь понимать, как Python работает под капотом , — добро пожаловать под капот CPython.
https://habr.com/ru/articles/1010390/
#python #cpython #garbage_collector #gc #memory_management #python_internals
-
I'm proud https://github.com/python/cpython/commit/61f2a1a5993967ed4b97ba93a4477c37fe68cf59 just landed in python! Support for IEEE floating point wave audio in core python, coming to python 3.15 this fall.
Thanks to Lionel Koenig for the original patch and to all code reviewers.
If you want to have better wave audio support in python *now* please check out my 'newwave' package: https://codeberg.org/michielb/newwave
-
Interesting post from @stanfromireland with an annotated chart showing the growth CPython's source code over the decades:
https://blog.python.org/2026/03/cpython-codebase-growth/
#Python #CPython #history -
A reminder in case you missed it: Diego Russo is keynoting #PyConIT 2026 🐍
CPython core dev, Arm Principal Engineer, EuroPython organiser; his talk covers how Python went from "fast enough" to “fast by design”.
🎟️ Tickets are still available:
🔗 https://pycon.it/tickets -
The Story of Python's Lazy Imports: Why It Took Three Years and Two Attempts
#Python #PEP810 #LazyImports #CPython #Performance #SoftwareEngineering #MetaCinder #Python315 #StartupTime #TechnicalDeepDive
-
labeille Package Registry stats
Top 3.15 Blockers (364 packages):
* PyO3 / Rust / maturin: 111
* C extension build failures: 108
* pydantic-core (transitive PyO3): 69
* numpy / scipy / meson: 43Once PyO3 adds 3.15 support, ~180 more packages will unlock (PyO3 direct + pydantic-core transitive)
Skip Reasons (418 packages):
* Monorepo subpackage (Azure, GCloud, etc.): 214
* No test suite found: 70
* No source repository: 52
* Type stub packages: 42 -
labeille Package Registry stats
We've grown the registry: https://github.com/devdanzin/labeille/tree/main/registry/packages
* Total packages: 1,500
* Enriched (information collected and present): 1,500 (100%)
* Fully runnable on CPython 3.15: 654 (43.6%)
* Skipped (no tests, monorepo, etc.): 418 (27.9%)
* 3.15-specific blockers (skip_versions): 364 (24.3%)
* pytest: 95.1% (1,427 packages)
* unittest: 4.8% (72 packages)
* GitHub: 96.4% of repos
* Same JIT crash found in 7 packages -
Source code analysis
cpython
doc/c-api/abstract.rsc
.. highlight:: c
.. _abstract:
Abstract Objects Layer
The functions in this chapter interact with Python objects regardless of their
type, or with wide classes of object types (e.g. all numerical types, or all
sequence types). When used on object types for which they do not apply, they
will raise a Python exception.It is not possible to use these functions on objects that are not properly
initialized, such as a list object that has been created by :c:func:PyList_New,
but whose items have not been set to some non-\NULLvalue yet... toctree::
object.rst
call.rst
number.rst
sequence.rst
mapping.rst
iter.rst
buffer.rst
objbuffer.rst▸Chapter 1 — Understanding CPython Before Code
CPython is both a compiler and an interpreter. It compiles Python source code to bytecode, then executes that bytecode on a stack-based virtual machine. Understanding this dual nature reveals how Python achieves its balance between high-level expressiveness and runtime efficiency.
Key Concepts:
Everything is an object: Integers, functions, classes, modules, even types themselves are objects with a uniform interface
The GIL: A mutex that protects Python objects, simplifying memory management but limiting CPU-bound parallelism
Memory Management: Reference counting (immediate) + cyclic garbage collection (for cycles)
Compilation Pipeline: Source → Tokens → AST → Bytecode → Executionmotivation
- It's important to know
- how to use a programming language
- it's tools
- compiler(s)
- assembler
- linker
It's vital to know how the compiler works from the source
- I dive in deep into the sources
- sit and read, learn the logic, check the remarks
- that gives and understanding of the workings of the whole suite of tools for that language
I used explorar.dev in this example, but you don't need the internet to analyse source code. Just download them once, then read at your leasure offline
The screencaps are included to show how it can be done via explorar.
Happy hacking!
Sources:
https://explorar.dev/python/cpython#python #cpython #programming #source #code #analysis #environment #mathematics #physics #Lineair #Algebra #technology #Linux #BSD #freeBSD #ghostBSD #OpenSource
-
Looks like #pyenv releases will now be more closely in sync with #CPython releases thanks to some newly implemented automation. That's great news!
Thanks to the devs for making this happen.
-
[Перевод] 5 ключевых изменений в Python 3.14 глазами инженера
Команда Python for Devs подготовила перевод статьи о ключевых изменениях в Python 3.14. Автор разбирает релиз через призму внутреннего устройства интерпретатора и производительности: свободная многопоточность, конкурентные интерпретаторы, удалённая отладка, инкрементальная сборка мусора и новый Tail Calling интерпретатор.
-
New account, so new #introduction. Let's do it again!
I have a #MastersDegree in #ComputerScience and #ComputerEngineering. I went to #NMU for undergrad and #MSU for my graduate degree. I currently work at #UChicago for the #TMWCenter, which focuses on helping young children acquire language (and therefore other learning skills) faster.
In my spare time, I develop #OpenSourceSoftware such as
- a #SphinxDoc extension that embed #Fediverse comments on your page
- a library to talk to #ManifoldMarkets from native #Python
- a #PredictionMarket manager using the above
- a #transpiler from a subset of Python to #OpenStreetMaps's #OverpassQL
- bug fixes to many other projects, including #mypy, #base58, #attrs, #CPython, & more
I spend a fair bit of my time these days on #MathResearch, specifically into the #ThueMorse Sequence and its extensions.
I'm also a hobbyist editor on OpenStreetMap.
#Demisexual, #transfem, and happily engaged to my #enby sweetheart.
We have two cats: #OpheTheLoaf and #MayalaranTheCat (yes, from #StormlightArchive) See here for more on them!
I speak English fluently, Spanish haltingly, and am trying to learn Chinese
#queer #Chicago -
Oh dang, my #introduction post is waaay out of date now. Let's do it again!
I have a #MastersDegree in #ComputerScience and #ComputerEngineering. I went to #NMU for undergrad and #MSU for my graduate degree. I currently work at #UChicago for the #TMWCenter, which focuses on helping young children acquire language (and therefore other learning skills) faster.
In my spare time, I develop #OpenSourceSoftware such as
- a library to talk to #ManifoldMarkets from native #Python
- a #PredictionMarket manager using the above
- a #transpiler from a subset of Python to #OpenStreetMaps's #OverpassQL
- bug fixes to many other projects, including #mypy, #base58, #attrs, #CPython, & more
I spend a fair bit of my time these days on #MathResearch, specifically into the #ThueMorse Sequence and its extensions.
I'm also a hobbyist editor on OpenStreetMap.
#Demisexual, #transfem, and happily engaged to my #enby sweetheart.
We have two cats: #OpheTheLoaf and #MayalaranTheCat (yes, from #StormlightArchive)