[New-bugs-announce] [issue28776] Duplicate method names should be an error

Peter Inglesby report at bugs.python.org
Tue Nov 22 15:49:46 EST 2016


New submission from Peter Inglesby:

It should be an error for a class to define a method twice.

That is, Python should raise an exception when the following code is loaded:

class C:
    def m(self):
        # do something
    def m(self):
        # do something

I have just witnessed a beginner get very confused by this!

(Apologies if this is a duplicate of an existing issue.)

----------
messages: 281513
nosy: inglesp
priority: normal
severity: normal
status: open
title: Duplicate method names should be an error

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


More information about the New-bugs-announce mailing list