home.social

#cpython — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #cpython, aggregated by home.social.

  1. @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.
    discuss.python.org/t/reverting
    #Python #CPython

  2. 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.

    github.com/python/cpython/issu

    #Gentoo #Python #CPython

  3. Inspired by @hugovk 's Bluesky Python core devs starter pack, I created one for Mastodon(.social): mastodon.social/collections/11

    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 #python #foss

  4. Как устроен словарь в CPython: compact dict, key sharing и что с ним делает free-threading

    У dict в Python слишком простая внешность: положили ключ, достали значение, пошли дальше. Но за этим стоит один из самых вылизанных участков CPython — с компактным хранением, сохранением порядка вставки, общими ключами для экземпляров классов, оптимизациями доступа к атрибутам и новыми компромиссами из-за free-threading. В статье разберём, почему обычный словарь давно перестал быть «просто хеш-таблицей», как его устройство влияет на память и скорость кода, и какие привычки Python-разработчика могут незаметно ломать быстрый путь интерпретатора. Разобрать dict

    habr.com/ru/companies/otus/art

    #python #CPython #словарь_Python #хештаблица #compact_dict #оптимизация_памяти

  5. It will be much better behaved in 3.15 though (the improved implementation will be in the upcoming 3.15b1 release) #python #cpython

  6. 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)

    #python #cpython

  7. 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 , и я с ними согласен.

    habr.com/ru/articles/1027354/

    #python #cpython #nuitka #nuitka_40 #pyinstaller

  8. 😂 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! 🛠️
    zef-lang.dev/implementation #Zef #HackerNews #ngated

  9. 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:
    github.com/devdanzin/cext-revi
    github.com/devdanzin/ft-review

    #Python #CPython

  10. 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

  11. 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.

    #Python #CPython

  12. 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: discuss.python.org/t/systemati

    But if you just want your C extension checked, reply below or DM me!
    #Python #CPython

  13. I've created a CPython umbrella issue for C bugs found with a new tool: github.com/python/cpython/issu

    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: github.com/python/cpython/issu

    Have fun!

    #Python #CPython

  14. 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

  15. GIL в Python для senior interview

    GIL — самая известная «фича» Python, о которой большинство разработчиков знают ровно одну фразу: «мешает многопоточности». Этого хватает для джуна, но не для сеньора. Статья построена так, чтобы после её прочтения вы могли не только ответить на вопросы по GIL на senior-интервью, но и объяснить коллеге-стажеру, что происходит внутри интерпретатора, когда два потока пытаются одновременно изменить один список.

    habr.com/ru/articles/1013930/

    #python #gil #backend #cpython

  16. 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:

    riverfount.dev.br/posts/python

    #python #freethreading #gil #cpython

  17. 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.
    yaal.coop/blog/en/dernieres-co

  18. 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.
    yaal.coop/blog/dernieres-contr

  19. Как устроены память и 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.

    habr.com/ru/articles/1010390/

    #python #cpython #garbage_collector #gc #memory_management #python_internals

  20. I'm proud github.com/python/cpython/comm 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: codeberg.org/michielb/newwave

  21. 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:
    🔗 pycon.it/tickets

    #PyConItalia #CPython #Python

  22. 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: 43

    Once 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

    #Python #CPython #JIT #registry #labeille

  23. labeille Package Registry stats

    We've grown the registry: github.com/devdanzin/labeille/

    * 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

    #Python #CPython #JIT #debugging #registry #labeille

  24. 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-\ NULL value 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 → Execution

    motivation

    • 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:
    explorar.dev/python/cpython

    #python #cpython #programming #source #code #analysis #environment #mathematics #physics #Lineair #Algebra #technology #Linux #BSD #freeBSD #ghostBSD #OpenSource

  25. @caten #Linux comes with #CPython - #Rust is not a requirement to use #python at all - Just Rust-programmed tools provide some candy for #python developpers, aka. #uv, #ruff...

  26. 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.

    github.com/pyenv/pyenv/issues/

    #Python

  27. [Перевод] 5 ключевых изменений в Python 3.14 глазами инженера

    Команда Python for Devs подготовила перевод статьи о ключевых изменениях в Python 3.14. Автор разбирает релиз через призму внутреннего устройства интерпретатора и производительности: свободная многопоточность, конкурентные интерпретаторы, удалённая отладка, инкрементальная сборка мусора и новый Tail Calling интерпретатор.

    habr.com/ru/articles/978836/

    #cpython #gil #производительность #интерпретатор #байткод

  28. 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

  29. 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

    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)

    #queer #Chicago