[Pyrex] array setting and math function annoyance

Robert Bradshaw robertwb at math.washington.edu
Thu Mar 13 07:07:00 CET 2008


On Mar 12, 2008, at 11:00 PM, Arc Riley wrote:

> Hey Greg, guys
>
> Two things;
>
> First, can we get array setting in the next version of Pyrex?  It  
> doesn't seem like a very difficult feature to implement, either with:
>
> cdef int c_array[5] = (1,1,2,3,5)
> # or
> cdef int c_array[5]
> c_array = (1,1,2,3,5)

You're right, this shouldn't be too hard to do. Nor should anonymous  
structures (though weird results might happen if a struct was  
declared differently in Cython than C)

> This would allow us to get rid of an obnoxious .c file in our source:
>   http://www.pysoy.org/browser/trunk/pysoy/src/textures/ 
> _tables4YUV.c?rev=703
>
>
> Second, there's a bug that's apparently been known for awhile where  
> certain math functions are unaware of the type of self, and thus,  
> self must be cast.  It's just an annoyance, but it'd be nice to be  
> rid of it.  Example;
>   http://www.pysoy.org/browser/trunk/pysoy/src/_datatypes/ 
> BodyPosition.pxi?rev=1137

Are you talking __add__ and friends? This is because the "self"  
argument may be in either the first or second position of the  
function. There is no __rmul__ either.

This is a Python/C api issue, not a Pyrex issue.

> It'd be easier to report and track these sort of things if there  
> was a Trac site for Pyrex, or some other bug tracker at the very  
> least.

You could file a bug at https://launchpad.net/cython/ and note that  
it also affects Pyrex.

- Robert




More information about the Pyrex mailing list