On Wed, Aug 27, 2008 at 6:02 PM, Ondrej Certik <[EMAIL PROTECTED]> wrote:
> On Wed, Aug 27, 2008 at 5:51 PM, Robert Bradshaw
> <[EMAIL PROTECTED]> wrote:
>>
>> On Aug 27, 2008, at 3:54 AM, Dag Sverre Seljebotn wrote:
>>
>>> Stefan Behnel wrote:
>>>>
>>>> Stefan Behnel wrote:
>>>>>
>>>>> we've already discussed a couple of times how to provide type
>>>>> information
>>>>> for pure Python source code. It was generally agreed that it's difficult
>>>>> to do so inside of the function body and easier to do for function
>>>>> signatures if we use Py3 annotations. I don't remember any good ideas
>>>>> how
>>>>> to provide type information for classes, i.e. how to make them extension
>>>>> types.
>>>
>>> Someone must have mentioned this?:
>>>
>>> @cython.cdef
>>> class A:
>>>    ...
>>>
>>> @cython.cdef
>>> def func(): ...
>>>
>>> Just mentioning it as a possibility.
>>
>> This is the way I was imagining doing it, especially as .pxd files move
>> towards being auto-generated. The proposal of being able to simply declare
>> them in the pxd file is an interesting one, and though it feels a bit sloppy
>> to me perhaps it would be good to support as well (curious for more input).
>
> There also needs to by some syntax to define variables etc, but
> anything that allows me to use the full power of Cython yet stay in
> pure Python is fine with me.

I am scarce on time, but I'd like to see this happen soon. How would
you suggest me to modify Cython to support that? I can try to write
some preparser, that takes pure python code (for example with
decorators specifying types) and turn it into a regular .pyx file that
Cython understands. But I am not sure if such a work would be helpful
to you, I guess the ultimate solution would be to modify the Cython
itself, but I am not sure how, without thorough studying of it, which
I am not sure how much time (days?) will take.

Those of you who know Cython well, if you have some ideas where I
should start to help get this done, it'd be awesome. I can spend
couple evenings on that.

Ondrej
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to