[Cython] Fused Types
Dag Sverre Seljebotn
d.s.seljebotn at astro.uio.no
Mon May 2 11:15:13 CEST 2011
On 05/01/2011 06:25 PM, Sturla Molden wrote:
> Den 01.05.2011 16:36, skrev Stefan Behnel:
>>
>> Not everyone uses C++. And the C++ compiler cannot adapt the code to
>> specific Python object types.
>
> Ok, that makes sence.
>
> Second question: Why not stay with the current square-bracket syntax?
> Does Cython
> need a fused-type in addition?
There is no current feature for templates in Cython currently, only
interfacing with C++ templates, which is rather different.
I.e., your question is very vague.
You're welcome to draft your own proposal for full-blown templates in
Cython, if that is what you mean. When we came up with this idea, we
felt that bringing the full power of C++ templates (including pattern
matching etc.) into Cython would be a bit too much; I think Cython devs
are above average sceptical to C++ and the mixed blessings of templates.
E.g., one reason for not wanting to do it the C++ way is the need to
stick largs parts of your program in header files. With fused types, the
valid instantiations are determined up front.
DS
More information about the cython-devel
mailing list