[Cython] Misleading error message when assigning function pointers with differing except* declarations
Michael Enßlin
michael at ensslin.cc
Thu May 7 15:13:13 CEST 2015
Hi,
consider the following example:
$ cat demo.pyx
cdef void (*foo)()
cdef void bar() except*:
pass
foo = bar
$ cython demo.pyx
Error compiling Cython file:
------------------------------------------------------------
...
cdef void (*foo)()
cdef void bar() except*:
pass
foo = bar
^
------------------------------------------------------------
demo.pyx:6:9: Cannot assign type 'void (void)' to 'void (*)(void)'
this is all expected behavior, but the error message is entirely
misleading; it should be something like
demo.pyx:6:9: Function pointers have incompatible 'except *' declarations.
Note that the same error message also occurs when the pointer is
declared except*, and the function isn't.
~ mic_e
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/cython-devel/attachments/20150507/e100f745/attachment.sig>
More information about the cython-devel
mailing list