So let's turn the question around: Since Coverity is user-extensible (and supports Python), can you write a Coverity rule which detects wrong use of some given NoDefault sentinel with a useful level of reliability?
Actually I feel this should be feasible. (And if so, mission accomplished?) Stephan 2017-03-02 15:18 GMT+01:00 Chris Angelico <[email protected]>: > On Fri, Mar 3, 2017 at 1:15 AM, Stephan Houben <[email protected]> wrote: >> I do not think such a magic linter can be written. >> It seems an obvious instance of the Halting Problem to me. > > Yeah it can :) Static analysis is pretty impressive these days. Check > out tools like Coverity, which can analyse your source code and tell > you that, at this point in the code, it's possible for x to be >100 > and y to have only 100 bytes of buffer, and then you index past a > buffer. You could do the same to track down the origin of an object in > Python. > > However, I think this is far from an ideal solution to the problem. > > ChrisA > _______________________________________________ > Python-ideas mailing list > [email protected] > https://mail.python.org/mailman/listinfo/python-ideas > Code of Conduct: http://python.org/psf/codeofconduct/ _______________________________________________ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/
