Dag Sverre Seljebotn wrote:
> 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.
>>     
Sorry, I misread you first time around -- you're talking about 
collisions with other *Python* libraries being named "c"? In that case 
I'd think the chances of collision are higher for anything else we could 
think of (like clib, libc).

The alternative then appears to be

from cython.c.math cimport sqrt
from cython.python cimport Py_INCREF

but that's awfully verbose.

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

Reply via email to