Note to self. I have kids who wake at 6.30 for school. I shouldn't program past 22.30, much less 23.30, as it's far too easy to make mistakes while tired.

In this case, what I thought was a fix, didn't work. So I'm back to trying to figure out what's up with getting #cython to build a #python extension class.

很多 Python 加速的方法

Gea-Suan Lin's BLOG

Can't figure out how to use #cython to define a reusable #python extension class.

In the .pxd

cdef class CountFingerprint:
cdef:
...

In the .pyx

from . import _typing

def _err(s):
return ValueError(s)

cdef class CountFingerprint:
def to_pandas(...) -> _typing.PDF:
..
raise _get_value_error(..)

cythonize says "Unknown type declaration '_typing.PDF' in annotation, ignoring" and "undeclared name not builtin: _get_err".

I don't get it. Those are defined in the .pyx.

Help?

#Cython promises to make "writing #C extensions for Python as easy as #Python itself." The reality is: learn C's mental model, express it in Python syntax, and use a separate diagnostic tool to verify.
https://github.com/cemrehancavdar/faster-python-bench/blob/main/docs/cython-minefield.md

#borgbackup 2.0.0b20 was just released!

There is quite some new stuff and also some fixes, please help with testing the betas!

https://github.com/borgbackup/borg/releases/tag/2.0.0b20

#backup #linux #bsd #macOS #openindiana #haiku #python #cython #borg

Release Release 2.0.0b20, beta quality, for testing only · borgbackup/borg

borgbackup 2.0.0b20 beta release - do not use this on production backup repositories. Long changelog: https://borgbackup.readthedocs.io/en/2.0.0b20/changes.html#version-2-0-0b20-2025-12-24 If you u...

GitHub

🐍👨‍💻 #PythoC — це новий проєкт, який дозволяє використовувати Python як генератор C-коду, пропонуючи більше можливостей і гнучкості, ніж #Cython. Це перший огляд нового інструмента генерації C-коду з #Python, орієнтованого передусім на створення самостійних C-програм.

🔗 https://proit.ua/pythoc-novi-mozhlivosti-ghienieratsiyi-c-kodu/
🔗 https://www.infoworld.com/article/4101101/pythoc-a-new-way-to-generate-c-code-from-python.html

Does anyone know of a good overview how much overhead using ctypes to call functions from a dynamic library adds to #python code instead of building a native extension e.g via #cython #pybind11 or #nanobind ?

A blog post with some statistics would be perfect but just ballpark figures from anyone who knows what they are talking about is fine

I have officially started working as the training coordinator at #MimerAIF (https://mimer-ai.eu/). What better way to kick things off than a course?! These days I am teaching parts of the #PythonForScicomp course in partnership with @coderefinery and @SciCompAalto.

Tomorrow is the last day of the course, but you can still join!

https://scicomp.aalto.fi/training/scip/python-for-scicomp-2025/

I will be covering the episodes on #Cython and #Packaging.

Fuzzing pyhacl (https://codeberg.org/drlazor8/pyhacl), a package of Cython bindings for HACL* (the High Assurance Cryptographic Library), with fusil we only found one crash.

It turned out to actually be a silly bug in #Cython:

Issue: https://github.com/cython/cython/issues/7263

Fix: https://github.com/cython/cython/pull/7264

Goes to show how fuzzing a C-extension can uncover crashes in many different layers.

Thanks @drlazor8 for taking up the call for C-extensions maintainers to fuzz their code.

#fusil #Python #pyhacl #hacl #fuzzing #fuzzer

pyhacl

cython wrapper around HACL* the Hight Assurance Cryptographic Library

Codeberg.org
Ah, the timeless quest for speed: From #Cython to #Mojo, because obviously what we all need is yet another layer of #complexity to solve the crippling issue of Python's infamous sloth 🐢🔥. Nothing says "a productive day" like translating code from one esoteric dialect to another while dreaming of the #performance gains that never quite materialize 🚀😂.
https://fnands.com/blog/2025/sklearn-mojo-dbscan-inner/ #Python #Speed #HackerNews #ngated
Translating Cython to Mojo, a first attempt – fnands

I kick the tires on Mojo’s new Python interop by translating some of scikit-learn’s Cython into Mojo