[Pyrex] Re: Pyrex parser bug

Florian Schulze florian.proff.schulze at gmx.net
Sat Jul 19 18:55:26 CEST 2003


On Sat, 19 Jul 2003 17:42:49 +0100 (BST), John J Lee <jjl at pobox.com> wrote:

> The following file causes a traceback instead of a Pyrex syntax error
> with Pyrex 0.8.2, Python 2.3b2 (0.7.2 / Python 2.2.1 also gives a
> traceback).
>
> Note the syntax error (using C-style () cast syntax instead of <>), and
> that BLAH is a macro which is (unintentionally) not declared in the Pyrex
> file.
>
> ------CUT HERE------
> ctypedef int foo
>
> cdef foo bar():
> cdef int i
>
> return (((foo)(i) << 1) | BLAH)
> ------CUT HERE------

I would say this is valid code. It tries to call foo with i as an argument.
Try this in Python:
((0, 1) (2, 3))
This is a very weird error message and hard to find bug for most newbies.

Florian





More information about the Pyrex mailing list