Stefan Behnel wrote:
> Dag Sverre Seljebotn, 02.02.2010 10:45:
>   
>> What I'm wondering about is whether we can start having namespaces in 
>> Cython/Includes. Especially since math is already a module, and I think 
>> "c.math" is clearer than inventing "cmath".
>>
>> So I propose:
>>
>> from c.math cimport sqrt, acos, cos, sin, round
>> from c.stdio cimport fopen
>>     
>
> I'm fine with namespaces, although I find "math" a particularly bad
> example. I'd like to be able to do this one day:
>
>     from math cimport sin
>
> and have it use the C library's sin() function. But I guess that just an
> orthogonal feature.
>
> I also wonder if "c" isn't a bit short for an unambiguous namespace. I
> doubt that it's already in use by any sensible code (exactly for that
> reason), but I'd like to make sure we keep the risk of naming collisions
> low, *exactly because* we start using packaged names here.
>   
Hmm, I just checked, and in Python, this

numpy = 3
import numpy.linalg

resulted in numpy being imported and overwriting the 3 with the module. 
So you may have a point.

(cimports has to come before one could assign anything to c, but still..)

Other options I can think of:
 - C
 - clib
 - libc
 - cc

Dag Sverre
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to