Christopher Barker, 15.04.2010 22:49: > Stefan Behnel wrote: >> It doesn't matter, though. If the code says >> >> def func(object obj not None): >> >> then it is clear that None should not be allowed, which may or may not make >> sense in a given situation. It certainly doesn't hurt anyone, so why should >> we actively keep users from doing this? > > well, it's kind of like: > > def func(int obj not 5): > > which would be a pretty cool feature, but I don't think we're trying to > support that!
The difference is that the 'not None' syntax is already there, so the question is: should we bother special casing 'object not None' and thus effectively give 'not None' a different meaning than just 'not None'? > > then it is clear that None should not be allowed > > True -- it's probably not a good idea to allow the syntax, but not have > it do anything, so I'd say either catch it at compile time, or have it > check for None at run time. The current code now checks for None at runtime on 'object not None'. Stefan _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
