On Fri, Oct 16, 2009 at 3:33 PM, Robert Bradshaw
<[email protected]> wrote:
> On Oct 16, 2009, at 8:15 AM, Lisandro Dalcin wrote:
>
>> On Fri, Oct 16, 2009 at 12:06 PM, Stefan Behnel
>> <[email protected]> wrote:
>>>
>>> Lisandro Dalcin wrote:
>>>> On Fri, Oct 16, 2009 at 3:58 AM, Stefan Behnel wrote:
>>>>>> cdef MyClass x = foo()
>>>>> I agree that extension type casts should be exact and tested ones
>>>>> should
>>>>> fail for None.
>>>>
>>>> What did you meant with "exact" ? Subclasses should pass the
>>>> typetest, right?
>>>
>>> Sorry, sure, "anything that qualifies as a true instance of the
>>> checked
>>> class", including subclasses.
>>>
>>
>> BTW, that would be also the case for builtin types? IIUC, currently we
>> check for *exactly* the type.
>
> No, I think that behavior should remain as is (for reasons previously
> documented).
>

Now I think that the CURRENT behavior should remain the same, because
of the usual concern of backward compatibility. If we start making
exact checks that fail for None, then chances are that we could
actually break code...

A possible backward way could be to  introduce (slightly) new syntax,
something like <SomeType??>, i.e using two '?' to indicate a
"stronger" type check disallowing None...



-- 
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to