Stefan Behnel, 03.12.2010 20:48:
> Dag Sverre Seljebotn, 03.12.2010 20:40:
>> Well, you don't loose anything with
>>
>> cdef double complex x = obj
>>
>> either, and it just seems a bit confusing to let "x.real = ..." have
>> subtly different meaning.
>
> True. Maybe aliasing "complex" to "double complex" isn't a simple after all.

... except when it is. ;)

Assuming that we always alias complex Python values to "double complex", 
the above doesn't actually hurt us. When users define a variable as type 
"complex", it's fine to make it mutable because he/she has just taken it 
out of the control of normal (non statically typed) Python behaviour. So 
only values for which Cython has no type information or which are 
explicitly defined as "object" will stay immutable because either Cython or 
Python will forbid assignments. Everything else is represented by a 
(mutable) C type anyway.

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

Reply via email to