[issue28776] Duplicate method names should be an error

R. David Murray report at bugs.python.org
Tue Nov 22 17:51:25 EST 2016


R. David Murray added the comment:

It isn't ignored.  The first definition is entered into the class dictionary, then the second definition replaces it.  That's why Victor talked about redefining a method, because that's what happens.  You can't really disentangle the two cases except by source inspection (a linter).  In the parameter list case, the parser has the information it needs to detect it in hand, and more importantly there is no meaning to "replacing" a parameter, so we can and do generate an error in that case.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28776>
_______________________________________


More information about the Python-bugs-list mailing list