[Bf-python] Pyrex - an easier way to write Python/C modules?

Yann Vernier yann at algonet.se
Fri Jan 7 17:18:15 CET 2005


On Fri, Jan 07, 2005 at 02:31:13PM +0200, Toni Alatalo wrote:
> On Sat, 6 Nov 2004, Yann Vernier wrote:
> 
> we just talked about this on irc, and at least from where i can see, Pyrex 
> might really benefit working on the BPython API. much easier for Python 
> programmers to understand and work on, and probably easier for anyone to 
> make the API more 'pythonic' too (if we start adding properties etc.?)

Attributes aren't that hard to write in C (compared to any other cPython
function), but the getattr/setattr code currently used is inefficient. I
posted an example of how this should be done earlier. That said, Pyrex
still makes it easier.

> > I messed around a while, and eventually got a drop in replacement for
> > Blender.Text working. Pyrex is written in Python, and could be better
> 
> was wondering about how to proceed, and thought that perhaps Yann could 
> commit the replacements he's made and whatever is needed to get them work 
> to the newly forked Tuhopuu (tuhopuu3) so we all could see and try them 
> there first -- how does that sound?

Sounds like a suggestion to make me commit things, which is risky but
that should be an experimental tree...

> perhaps the Tuhopuu admins wouldn't even mind having Pyrex as an extra 
> requirement for compiling? otherwise i guess it could be a build option 
> (while keeping the c written parts there too to enable non-pyrex build).

It's not a huge requirement. Pyrex only requires Python, and would only
be required for building the Python interfaces. 

> > integrated with scons than this - it already has a module to extend
> > distutils. 
> > http://nz.cosc.canterbury.ac.nz/~greg/python/Pyrex/

I went ahead and wrote a snippet that loads the Pyrex Compiler straight
into SCons. While not complete - it doesn't collect dependencies and
such - this makes it less platform reliant, I think.



More information about the Bf-python mailing list