On Oct 20, 2008, at 10:48 AM, Gabriel Gellner wrote: > So I am trying to get my mind around how the newish pxd packages work, > that is when I have a folder with pxd files and an __init__.py file. > > Suppose I want the following structure: > > foo/ > math.pxd > param.pxd > > So that I can do > > cimport foo > > foo.math.func() > foo.param.PI > > # etc > > > Can this be done? (I know that I can do cimport foo.math, but can > use use the > __init__.py file in some way to be able to use the pxd files like a > normal > package?)
No, I don't think you can do this. In Python, foo.math is an actual object that can be further queried. Perhaps we should support this. > Secondly, how to I set the include path for pxd packages in setup.py > > I know I do `cython -I .` etc for doing it by hand. Any tips? There's an include_dir option you can pass to the setup command. > Finally our Pyrex difference states that package names and cross > directory > imports are just like python, is there anywhere that explains the > semantics > for Pyrex? I'm not sure, but I know they've changed over time. It used to be that you had to sit everything in the same folder, and just name the files "a.b.c" rather than putting stuff in folders. - Robert _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
