[Pyrex] array setting and math function annoyance

Jim Kleckner jek-gmane at kleckner.net
Fri Mar 14 23:06:25 CET 2008


Robert Bradshaw wrote:
> On Mar 13, 2008, at 12:14 AM, Arc Riley wrote:
[snip]
>> We'd be using Cython if it were not for a few pesky bugs we've yet  
>> to work around, namely our source is arranged in a manner which  
>> Cython cannot handle;
>>
>> src/<extension>/soy.<extension>.pyx which includes src/<extension>/ 
>> <EachClass>.pxi
>>
>> The resulting compile, as you could likely guess, raises errors  
>> such as:
>>   AttributeError: 'src.colors.soy.colors.Color' object has no  
>> attribute '_a'
> 
> 
> Yes, we handle submodule naming based on the directory hierarchy to  
> be consistent with Python. Sorry this doesn't work for you.

See this thread for a detailed discussion of this topic:
  http://thread.gmane.org/gmane.comp.python.pyrex/3063

See this wiki page for some notes from David McNab on how
to address this issue:
  http://wiki.cython.org/PackageHierarchy
You might want to add comments there.

Like you, Arc, I would prefer that I could use one
set of file names that would work for both Pyrex and Cython.
I ended up creating a Makefile that can switch between
cython and pyrex and a small helper script to link the pyx
and pxd files under both naming conventions.

The Makefile passes into setup.py a parameter to tell it
which names and paths to use depending on the compiler.
Yes, it is a hack but it allows me to switch back and forth
for testing.  (The Makefile runs "python setup.py usecython"
from the parent directory to make this all work).




More information about the Pyrex mailing list