Peter Inglesby added the comment:

Victor, I'm not talking about redefining a method, and David, I don't think I'm 
talking about changing dynamic nature of the class dictionary.

All I'm suggesting is that if some code contains a class whose body defines the 
same method twice, Python should treat it as an error.  At the moment, as far 
as I can tell, the first method is ignored.  Is there any situation where this 
behaviour is useful?

Python already handles a somewhat similar situation by raising a SyntaxError 
when it encounters a function whose parameter list contains duplicates:

>>> def f(a, a):
...   pass
... 
  File "<stdin>", line 1
SyntaxError: duplicate argument 'a' in function definition

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28776>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to