[c-api]Transmutation of an extension object into a read-only buffer adding an integer in-place.

Giacomo Alzetta giacomo.alzetta at gmail.com
Sat Aug 11 02:21:06 EDT 2012


Il giorno venerdì 10 agosto 2012 20:50:08 UTC+2, Stefan Behnel ha scritto:
> Giacomo Alzetta, 10.08.2012 10:20:
> 
> > I'm trying to implement a c-extension which defines a new class(ModPolynomial on the python side, ModPoly on the C-side).
> 
> > At the moment I'm writing the in-place addition, but I get a *really* strange behaviour.
> 
> 
> 
> You should take a look at Cython. It makes these things way easier and
> 
> safer than with manually written C code. It will save you a lot of code,
> 
> debugging and general hassle.
> 
> 
> 
> Stefan

I already know Cython, but I hope to learn a bit how python works from the C-side writing this extension.

Also this work is going to be included in a research work I'm doing, so I'd prefer to stick to Python and C, without having to put cython sources or cython-generated c modules(which I know are almost completely unreadable from a human point of view. Or at least the ones I saw).

Anyway thank you for the suggestion.



More information about the Python-list mailing list