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

Yann Vernier yann at algonet.se
Fri Jan 7 18:26:04 CET 2005


On Fri, Jan 07, 2005 at 11:55:27AM -0500, Stephen Swaney wrote:
> You can certainly criticize the code as being inefficient, but when a
> lot of it was written, there was no other way.  In older versions of
> Python, there was a great difference between built-in and user-defined
> types.

True. It is a pity that this technicality led to the preference of
setters and getters though, as it is much more convenient to work with
attributes from the Python side. 

> As Python itself evolves and the difference between types and classes
> disappears, we should definitely take advantage of the newer features
> like the new attribute access methods.  Whether it is worthwhile to go
> back and redo existing, working code is left as an exercise for the
> reader.

Looks like a weak "maybe" considering the reaction to my post on the
subject. Getting more review of the code would probably be a good idea
anyhow.

> My personal preference is for the more 'pythonic' attribute access
> rather than the getStuff()/setStuff() style.  I would like to see
> new code done this way.

I agree.


> > 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.
> 
> One of the biggest benefits of using SCons is that it deals with
> dependencies correctly.  Not a thing to give up lightly.

I did not drop it, but rather have not figured out how to write it yet.
Implementing the Pyrex compiler as a SCons rule rather than an external
command rule may be a step in doing so, as dependency tracking requires
parsing the code to some extent. It is not clear if Pyrex has the
capability to parse for just dependencies though, right now I just
compile.



More information about the Bf-python mailing list