Here's hopefully a working link; GitHub's rendering seems to be iffy: https://nbviewer.jupyter.org/urls/gist.githubusercontent.com/nicktimko/5f08d6adfa1dbe1319c3bfc715ec0aa4/raw/37dd95cd92be7b7e5af01b98ce9e8e00a705b3f7/override_guard.ipynb
Knowing how to do some introspection with dunder magic attributes can make tracing methods easier. There's also a bunch of caveats that could probably bite you (and make my demo full of holes) On Fri, Nov 25, 2016 at 10:26 PM, Guido van Rossum <gu...@python.org> wrote: > This idea is being kicked around from forum to forum and nobody wants to > have it. > > Here it's brought up from time to time and the response is usually "let a > linter do it". > > In mypy (which is essentially a powerful linter) it was proposed ( > https://github.com/python/mypy/issues/1888) and the response was > essentially "better go to python-ideas or bugs.python.org". > > It's also been proposed as a PEP 484 feature: https://github.com/python/ > typing/issues/269#issuecomment-243765549 . > > I think one reason why such proposals are unwelcome to experienced users > may be that when done right this is totally legitimate, and the requirement > to use an @override decorator is just making code more verbose with very > little benefit. (I could see a benefit -- if this is used consistently it > could make spelunking a large codebase easier, because you would know which > methods are overrides. Something like mypy could then enforce its use. But > an IDE could also just highlight method overrides differently, maybe > PyCharm or PyDev already do that?) > > -- > --Guido van Rossum (python.org/~guido <http://python.org/%7Eguido>) > > _______________________________________________ > Python-ideas mailing list > Python-ideas@python.org > https://mail.python.org/mailman/listinfo/python-ideas > Code of Conduct: http://python.org/psf/codeofconduct/ >
_______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/