Related thread https://mail.python.org/pipermail/python-ideas/2016-July/041095.html
On Nov 23, 2016 20:30, "François Leblanc" <fleblan...@gmail.com> wrote: > > I can imagine using a metaclass specialized witch can be activate or > desactivate but the cost of decorator > call still be here... > > I think its will be a good improvement if we can provide a solution for > this, and i ask myself if this can be set > > in interpreter with a flag to activate for exemple and with no performance > cost without the flag set, so you > > will have the choice and a good way to check youre code. > > To have no performance cost perhaps the best way it's to use docstring and > pylint... > > > > 2016-11-23 10:10 GMT+01:00 Paul Moore <p.f.mo...@gmail.com>: > >> On 23 November 2016 at 08:08, François Leblanc <fleblan...@gmail.com> >> wrote: >> > It's why I'd prefer this integrate in language, but if there no way to >> get >> > it without performance cost >> > I will have a look to a pylint solution... >> >> The point here is that if there is a way to get it without a >> performance cost (I can't imagine there would be, it's got to add a >> check for whether you're overriding a method at a minimum, but you may >> be able to come up with something) then you can do that within the >> language as it stands. It may need a specialised metaclass, but that's >> not a problem. At least, if it *is* an issue to you, you can argue for >> having it be the behaviour of the default metaclass once you've >> demonstrated that it works and doesn't hurt performance. And if there >> is a performance hit, then having the behaviour as opt-in based on a >> custom metaclass means that people can choose if they want to pay that >> cost. >> >> Paul >> > > > _______________________________________________ > 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/