Cython 3.2 - Function signature does not match previous declaration

24 views
Skip to first unread message

David Lawson

unread,
Nov 11, 2025, 4:46:49 AM (8 days ago) Nov 11
to cython-users
I'm trying to update a cython based library to work with Python 3.14, and happened to start around the same time that Cython 3.2 was released.

The following code will compile and work on Cython < 3.2:

test.py:
def fun1():
    return 1

test.pxd:
cpdef long fun1() except -1

but on 3.2 I get "test.py:1:0: Function signature does not match previous declaration".

I believe the issue is the "except -1" as removing it solves the issue, I suppose we are defining the return type as long but -1 is int?

Is this likely to be intentional? The closest think I think I can spot on the changelog is https://github.com/cython/cython/pull/6908 but that seems to be referring more to exceptions in Python.

da-woods

unread,
Nov 11, 2025, 2:04:52 PM (7 days ago) Nov 11
to cython...@googlegroups.com

That's a bug - I've just made a PR for a fix.

--

---
You received this message because you are subscribed to the Google Groups "cython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cython-users...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/cython-users/43541660-a237-42a0-a690-2a6792320252n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages