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

Re: [Cython] Conditional cast and builtin types

2013-06-07 Thread Stefan Behnel
Nikita Nemkin, 07.06.2013 13:14: > I have just discovered that the following operations do not perform > any type checking ("?" is ignored): > > obj, obj, obj, obj, obj. > > Can someone please confirm this as a bug? I never tried it, but (or rather, therefore) I can well imagine that it doesn't

[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

[Cython] Conditional cast and builtin types

2013-06-07 Thread Nikita Nemkin
Hi, I have just discovered that the following operations do not perform any type checking ("?" is ignored): obj, obj, obj, obj, obj. Can someone please confirm this as a bug? Best regards, Nikita Nemkin ___ cython-devel mailing list cython-devel@pyt