[Cython] Initializing var to struct?
Hoyt Koepke
hoytak at cs.ubc.ca
Wed Sep 3 17:45:36 CEST 2008
Hi,
Here was my use case:
I wanted to have a single structure that holds a bunch of option
parameters for my algorithm. This structure would get passed around
between some of the functions, and some of the particular options are
in the inner loop of things and so I wanted access to be quick. I
wanted to put the defaults in the structure definition and then allow
the user to change them if needed after creating the structure. I
ended up using an extension class w/ constructor to hold the options,
which I think is a better solution, but perhaps there are other use
cases.
--Hoyt
On Wed, Sep 3, 2008 at 6:38 PM, Lisandro Dalcin <dalcinl at gmail.com> wrote:
> Well, if that could be supported, perhaps it would be a good feature ;-).
>
> On Wed, Sep 3, 2008 at 12:10 PM, Dag Sverre Seljebotn
> <dagss at student.matnat.uio.no> wrote:
>> Was this ever supposed to work, if so, what did it do?
>>
>> cdef struct A:
>> int a = 4
>>
>> I have code to disallow it ready (raise compiler error) but then I
>> thought that perhaps it had a purpose (how else did Hoyt run into it...)
>>
>> http://trac.cython.org/cython_trac/ticket/64
>>
>> --
>> Dag Sverre
>> _______________________________________________
>> Cython-dev mailing list
>> Cython-dev at codespeak.net
>> http://codespeak.net/mailman/listinfo/cython-dev
>>
>
>
>
> --
> Lisandro Dalcín
> ---------------
> Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
> Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
> Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
> PTLC - Güemes 3450, (3000) Santa Fe, Argentina
> Tel/Fax: +54-(0)342-451.1594
> _______________________________________________
> Cython-dev mailing list
> Cython-dev at codespeak.net
> http://codespeak.net/mailman/listinfo/cython-dev
>
--
+++++++++++++++++++++++++++++++++++
Hoyt Koepke
UBC Department of Computer Science
http://www.cs.ubc.ca/~hoytak/
hoytak at gmail.com
+++++++++++++++++++++++++++++++++++
More information about the Cython-dev
mailing list