[Cython] On the topic of wrapper classes
Robert Bradshaw
robertwb at math.washington.edu
Sat Jul 25 21:21:27 CEST 2009
Well, I propose someone write up a CEP. I'm not opposed to the idea
but in particular I have yet to see a syntax that I'd be happy with.
- Robert
On Jul 25, 2009, at 10:41 AM, Chris Colbert wrote:
> +1
>
> On Fri, Jul 24, 2009 at 11:21 AM, Lisandro
> Dalcin<dalcinl at gmail.com> wrote:
>> On Fri, Jul 24, 2009 at 8:53 AM, Robert
>> Bradshaw<robertwb at math.washington.edu> wrote:
>>> This feels a lot like C++ operator overloading...
>>>
>>> I'm not a fan of _as_parameter_, but maybe an "as foo_t" kind of
>>> attribute that it would use every time it needed to convert it to a
>>> foo_t (not just as a parameter, but in assignment, etc.) Certainly
>>> something like this could be useful, but I'm not sure if it's
>>> needed.
>>>
>>
>> Well, such feature would make mpi4py/petsc4py/slepc4py/tao4py
>> codebase
>> simpler... All my cdef classes are proxies to C handles... I'm
>> constantly calling "self.handle" when calling library routines...
>>
>>
>>> On Jul 23, 2009, at 8:29 PM, David P. Novakovic wrote:
>>>
>>>> http://docs.python.org/library/ctypes.html#calling-functions-with-
>>>> your-own-custom-data-types
>>>>
>>>> I notice it only accepts basic types... and obviously the
>>>> implementation would be a lot simpler than what I am talking about
>>>> for cython... but that's the general gist of it.
>>>>
>>>> I guess for cython it would be nice to be able to have a mapping of
>>>> type -> attribute (or type_name -> attribute_name) so that when the
>>>> class is passed as a parameter the attribute of the right type is
>>>> passed instead.
>>>>
>>>> David
>>>>
>>>> On Fri, Jul 24, 2009 at 1:23 PM, Lisandro Dalcin
>>>> <dalcinl at gmail.com> wrote:
>>>> On Thu, Jul 23, 2009 at 11:44 PM, David P.
>>>> Novakovic<davidnovakovic at gmail.com> wrote:
>>>>>
>>>>> It's already a feature in the python stdlib through ctypes, so it
>>>> obviously
>>>>> doesn't break the guidelines that much.
>>>>>
>>>>
>>>> Sorry for my ignorance about ctypes... But could you point me to
>>>> some
>>>> code/link or provide some more comments in order I can
>>>> understand what
>>>> you commented above?
>>>>
>>>>
>>>>
>>>> --
>>>> 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
>>>>
>>>> _______________________________________________
>>>> Cython-dev mailing list
>>>> Cython-dev at codespeak.net
>>>> http://codespeak.net/mailman/listinfo/cython-dev
>>>
>>> _______________________________________________
>>> 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
>>
> _______________________________________________
> Cython-dev mailing list
> Cython-dev at codespeak.net
> http://codespeak.net/mailman/listinfo/cython-dev
More information about the Cython-dev
mailing list