Re: [Cython] Feature proposal: conditional cast with None

2013-06-07 Thread Nikita Nemkin
On Fri, 07 Jun 2013 19:10:34 +0600, Stefan Behnel wrote: Nikita Nemkin, 07.06.2013 13:24: Currently, conditional casts like obj do not allow None values. This might seem like an inconsistency, because obj does allow None values, just like a normal assignment. However, it's a special case t

Re: [Cython] Feature proposal: conditional cast with None

2013-06-07 Thread Stefan Behnel
Nikita Nemkin, 07.06.2013 13:24: > Currently, conditional casts like obj do not allow None values. This might seem like an inconsistency, because obj does allow None values, just like a normal assignment. However, it's a special case that asks explicitly for the given type, so I think it's ok to b

[Cython] Feature proposal: conditional cast with None

2013-06-07 Thread Nikita Nemkin
Hi, Currently, conditional casts like obj do not allow None values. I have found it useful to allow None sometimes. The syntax could be one of: * obj * obj * obj Use case (without this feature): tn_obj = self.any.non_trivial.nullable.expression() cdef TypeName tn if tn_obj is not