On Mar 15, 2009, at 2:48 PM, Greg Ewing wrote:
> Stefan Behnel wrote:
>> Carl Witty wrote:
>>
>>> Hmm... I hope that eventually Cython will allow overriding
>>> __new__, at
>>> which point calling an extension type won't necessarily return a
>>> value
>>> of that type.
>>
>> I'm not sure. This
Stefan Behnel wrote:
> Carl Witty wrote:
>
>>Hmm... I hope that eventually Cython will allow overriding __new__, at
>>which point calling an extension type won't necessarily return a value
>>of that type.
>
> I'm not sure. This should certainly be supported for Python classes, but
> for extension
On Mar 13, 2009, at 12:39 PM, Santiago Aguiar wrote:
> Lisandro Dalcin wrote:
>> Santiago, have you considered writing a simple script to generate
>> Cython code :-) ?? You could parse a simple txt file with metadata
>> about your C-level structs (name, field types, fieldname, and even
>> default
Lisandro Dalcin wrote:
> Santiago, have you considered writing a simple script to generate
> Cython code :-) ?? You could parse a simple txt file with metadata
> about your C-level structs (name, field types, fieldname, and even
> default field values), then you could easily dump Cython code
> auto
Robert Bradshaw wrote:
> On Mar 13, 2009, at 10:24 AM, Carl Witty wrote:
>> How about this? In the hypothetical future version of Cython that
>> allows overriding __new__, say that the overrides have to be declared
>> in the .pxd file, with
>>
>> cdef TYPE __new__(self, foo, bar)
>>
>> (where T
On Mar 13, 2009, at 12:53 AM, Stefan Behnel wrote:
>
> Santiago Aguiar wrote:
>> I've started to use Cython just yesterday, and I'm facing some
>> difficulties ;). I'm sorry to ask this on the dev list, but I didn't
>> found a user specific one...
>>
>> I have a struct-dense C source code that def
On Mar 13, 2009, at 10:24 AM, Carl Witty wrote:
> On Fri, Mar 13, 2009 at 10:11 AM, Lisandro Dalcin
> wrote:
>> On Fri, Mar 13, 2009 at 2:39 PM, Stefan Behnel
>> wrote:
>>> So, can't we just require that ExtType.__new__() returns an
>>> instance of
>>> ExtType (or its subtypes)?
>>
>> As a
On Fri, Mar 13, 2009 at 10:11 AM, Lisandro Dalcin wrote:
> On Fri, Mar 13, 2009 at 2:39 PM, Stefan Behnel wrote:
>> So, can't we just require that ExtType.__new__() returns an instance of
>> ExtType (or its subtypes)?
>
> As a first approach, it could be like that...
>
> ? Or is there a use case
Santiago, have you considered writing a simple script to generate
Cython code :-) ?? You could parse a simple txt file with metadata
about your C-level structs (name, field types, fieldname, and even
default field values), then you could easily dump Cython code
automating the member, __cinit__() me
On Fri, Mar 13, 2009 at 2:39 PM, Stefan Behnel wrote:
>>
>> comm = MPI.Comm(MPI.COMM_WORLD)
>> assert comm is MPI.COMM_WORLD
>>
>> and the assertion will succeed...
>
> Am I right in guessing that Comm is an extension type here and that
> COMM_WORLD is an instance?
>
Yes, you are right...
> So y
Stefan Behnel wrote:
> Why don't you reference the struct itself here? Do you really need these
> fields to be public?
>
I could, but in that case I would need to write getters/setters for each
attribute. In my code, almost all the struct fields are relevant, since
they represent fields in th
On Fri, Mar 13, 2009 at 9:39 AM, Stefan Behnel wrote:
> So, can't we just require that ExtType.__new__() returns an instance of
> ExtType (or its subtypes)? Or is there a use case that would benefit from
> returning arbitrary things?
I have code (currently in pure Python, but if I ever transition
Lisandro Dalcin wrote:
> On Fri, Mar 13, 2009 at 12:46 PM, Stefan Behnel wrote:
>> Carl Witty wrote:
>>> Hmm... I hope that eventually Cython will allow overriding __new__, at
>>> which point calling an extension type won't necessarily return a value
>>> of that type.
>>
>> I'm not sure. This shoul
Lisandro Dalcin wrote:
> On Fri, Mar 13, 2009 at 12:42 PM, Carl Witty wrote:
>> On Fri, Mar 13, 2009 at 12:53 AM, Stefan Behnel
>> wrote:
I don't understand why I'm getting the error. If I call a cdef
function
instead of a cdef method, it works OK; but shouldn't I be able to call
>
On Fri, Mar 13, 2009 at 12:46 PM, Stefan Behnel wrote:
> Carl Witty wrote:
>> Hmm... I hope that eventually Cython will allow overriding __new__, at
>> which point calling an extension type won't necessarily return a value
>> of that type.
>
> I'm not sure. This should certainly be supported for P
On Fri, Mar 13, 2009 at 12:42 PM, Carl Witty wrote:
> On Fri, Mar 13, 2009 at 12:53 AM, Stefan Behnel wrote:
>>> I don't understand why I'm getting the error. If I call a cdef function
>>> instead of a cdef method, it works OK; but shouldn't I be able to call a
>>> cdef method and passing a C typ
Carl Witty wrote:
> On Fri, Mar 13, 2009 at 12:53 AM, Stefan Behnel wrote:
>>> I don't understand why I'm getting the error. If I call a cdef function
>>> instead of a cdef method, it works OK; but shouldn't I be able to call
>>> a
>>> cdef method and passing a C type instead of a Python type? Othe
On Fri, Mar 13, 2009 at 12:53 AM, Stefan Behnel wrote:
>> I don't understand why I'm getting the error. If I call a cdef function
>> instead of a cdef method, it works OK; but shouldn't I be able to call a
>> cdef method and passing a C type instead of a Python type? Otherwise, I
>> will need to a
Stefan Behnel wrote:
> Santiago Aguiar wrote:
>
>> return Msg1().from_c(&msg.data.msg_1)
>>
>> I get an error message saying that: 'Cannot convert
>>'msg1_c_struct *' to Python object' where I do the Msg1().from_c.
>
> I consider this a deficiency of Cython. It should know the type of t
Santiago Aguiar wrote:
> I've started to use Cython just yesterday, and I'm facing some
> difficulties ;). I'm sorry to ask this on the dev list, but I didn't
> found a user specific one...
>
> I have a struct-dense C source code that defines the PDU of a network
> protocol and functions to re
Hello,
I've started to use Cython just yesterday, and I'm facing some
difficulties ;). I'm sorry to ask this on the dev list, but I didn't
found a user specific one...
I have a struct-dense C source code that defines the PDU of a network
protocol and functions to read/write from a buffer struc
21 matches
Mail list logo