On Apr 13, 2010, at 8:12 AM, Stefan Behnel wrote: > Dag Sverre Seljebotn, 13.04.2010 16:28: >> Stefan Behnel wrote: >>> Dag Sverre Seljebotn, 13.04.2010 09:11: >>> >>>> The argument against changing the default is simply that there is >>>> another option which is much closer to Python semantics >>>> >>> >>> I think the "another option" bit in this sentence is at the core >>> of our >>> disagreement. My point is that incorrect input should be caught >>> early, and >>> None is incorrect (and dangerous) input in almost all cases where >>> a typed >>> value is expected. So rejecting this dangerous input should be the >>> default. >> >> I'll just repeat Robert: I think the core of the disagreement is that >> >> def f(X x): >> ... >> >> should correspond directly to >> >> def f(obj): >> cdef X x = obj >> >> I.e., no special casing of arguments vs. other typed variables. > > Yes, I disagree with that, simply because they already are > different. You > can't do > > cdef X not None x = obj > > but you can do > > cdef X x = <X?>obj > > to mimic the "not None" semantics.
No, <X?>obj allows None just fine. We could extend the syntax to <X? not None> but that's not there now. - Robert _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
