You can do it at run-time, if you so desire, without a measurable
performance hit with a metaclass. Here's a hacky demo:
https://gist.github.com/nicktimko/5f08d6adfa1dbe1319c3bfc715ec0aa4#file-override_guard-ipynb

(Pedants: Any performance hit will be constant-time and probably less than
a stray import that you don't need. If you're worried about optimizing
constant-time things, I think you have larger problems.)

On Thu, Nov 24, 2016 at 5:48 PM, Victor Stinner <victor.stin...@gmail.com>
wrote:

> Similar or related issue recently open and quickly closed:
> http://bugs.python.org/issue28776
> "Duplicate method names should be an error"
>
> In short, such job should be done by linters. I'm quite sure that many
> of them already implement such check.
>
> Victor
> _______________________________________________
> 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/

Reply via email to