[Cython] Fused Types

Dag Sverre Seljebotn d.s.seljebotn at astro.uio.no
Mon May 2 15:07:42 CEST 2011


On 05/02/2011 03:00 PM, Sturla Molden wrote:
> Den 02.05.2011 11:15, skrev Dag Sverre Seljebotn:
>>
>> I.e., your question is very vague.
>
> Ok, what I wanted to ask was "why have one syntax for interfacing C++
> templates and another for generics?" It seems like syntax bloat to me.

But we do that. The CEP specifies that if you have

def f(floating x): return x**2

then "f[double]" will refer to the specialization where 
floating==double, and calling f[double](3.4f) will make the float be 
upcast to a double.

There's no [] within the function definition, but there's no "prior art" 
for how that would look within Cython.

Dag Sverre


More information about the cython-devel mailing list