Stefan Behnel | 12 Jun 2012 16:13
Picon
Favicon

[Cython] "__pyx_dynamic_args" undeclared in fused types code

Hi,

after the merge of the "_fused_dispatch_rebased" branch, I get C compile
errors in a simple fused types example:

"""
from cython cimport integral

# define a fused type for different containers
ctypedef fused container:
    list
    tuple
    object

# define a generic function using the above types
cpdef sum(container items, integral start = 0):
    cdef integral item, result
    result = start
    for item in items:
        result += item
    return result

def test():
    cdef int x = 1, y = 2

    # call [list,int] specialisation implicitly
    print( sum([1,2,3,4], x) )

    # calls [object,long] specialisation explicitly
    print( sum[object,long]([1,2,3,4], y) )
(Continue reading)

mark florisson | 13 Jun 2012 17:26
Picon
Gravatar

Re: [Cython] "__pyx_dynamic_args" undeclared in fused types code


On Jun 12, 2012 8:15 PM, "Stefan Behnel" <stefan_ml-KjMAwuNBv5izQB+pC5nmwQ@public.gmane.org> wrote:
>
> Hi,
>
> after the merge of the "_fused_dispatch_rebased" branch, I get C compile
> errors in a simple fused types example:
>
> """
> from cython cimport integral
>
> # define a fused type for different containers
> ctypedef fused container:
>    list
>    tuple
>    object
>
> # define a generic function using the above types
> cpdef sum(container items, integral start = 0):
>    cdef integral item, result
>    result = start
>    for item in items:
>        result += item
>    return result
>
> def test():
>    cdef int x = 1, y = 2
>
>    # call [list,int] specialisation implicitly
>    print( sum([1,2,3,4], x) )
>
>    # calls [object,long] specialisation explicitly
>    print( sum[object,long]([1,2,3,4], y) )
> """
>
> The C compiler complains that "__pyx_dynamic_args" is undeclared -
> supposedly something should have been passed into the function but wasn't.
>
> Mark, could you take a look?
>
> Stefan
> _______________________________________________
> cython-devel mailing list
> cython-devel-+ZN9ApsXKcEdnm+yROfE0A@public.gmane.org
> http://mail.python.org/mailman/listinfo/cython-devel

Thanks for pointing that out Stefan, I'll get that fixed for 0.17.

<div>
<p><br>
On Jun 12, 2012 8:15 PM, "Stefan Behnel" &lt;<a href="mailto:stefan_ml@..." target="_blank">stefan_ml@...</a>&gt; wrote:<br>
&gt;<br>
&gt; Hi,<br>
&gt;<br>
&gt; after the merge of the "_fused_dispatch_rebased" branch, I get C compile<br>
&gt; errors in a simple fused types example:<br>
&gt;<br>
&gt; """<br>
&gt; from cython cimport integral<br>
&gt;<br>
&gt; # define a fused type for different containers<br>
&gt; ctypedef fused container:<br>
&gt; &nbsp; &nbsp;list<br>
&gt; &nbsp; &nbsp;tuple<br>
&gt; &nbsp; &nbsp;object<br>
&gt;<br>
&gt; # define a generic function using the above types<br>
&gt; cpdef sum(container items, integral start = 0):<br>
&gt; &nbsp; &nbsp;cdef integral item, result<br>
&gt; &nbsp; &nbsp;result = start<br>
&gt; &nbsp; &nbsp;for item in items:<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp;result += item<br>
&gt; &nbsp; &nbsp;return result<br>
&gt;<br>
&gt; def test():<br>
&gt; &nbsp; &nbsp;cdef int x = 1, y = 2<br>
&gt;<br>
&gt; &nbsp; &nbsp;# call [list,int] specialisation implicitly<br>
&gt; &nbsp; &nbsp;print( sum([1,2,3,4], x) )<br>
&gt;<br>
&gt; &nbsp; &nbsp;# calls [object,long] specialisation explicitly<br>
&gt; &nbsp; &nbsp;print( sum[object,long]([1,2,3,4], y) )<br>
&gt; """<br>
&gt;<br>
&gt; The C compiler complains that "__pyx_dynamic_args" is undeclared -<br>
&gt; supposedly something should have been passed into the function but wasn't.<br>
&gt;<br>
&gt; Mark, could you take a look?<br>
&gt;<br>
&gt; Stefan<br>
&gt; _______________________________________________<br>
&gt; cython-devel mailing list<br>
&gt; <a href="mailto:cython-devel@..." target="_blank">cython-devel@...</a><br>
&gt; <a href="http://mail.python.org/mailman/listinfo/cython-devel" target="_blank">http://mail.python.org/mailman/listinfo/cython-devel</a></p>
<p>Thanks for pointing that out Stefan, I'll get that fixed for 0.17.</p>
</div>

Gmane