[Python-Dev] Why wont duplicate methods be flagged as error (syntax or anything suitable error) (original) (raw)

Steven D'Aprano steve at pearwood.info
Sun Jan 14 04:09:16 EST 2018


On Sun, Jan 14, 2018 at 11:10:33AM +0300, joannah nanjekye wrote:

[...]

Is this sort of method name duplication important in any cases?

Yes. For example, inside a class:

class MyClass(object): @property def something(self): pass

@something.setter
def something(self):
    pass

Not aimed at criticism, just to understand.

This mailing list is not really for general discussions about Python, this is for the development of the Python interpreter. For questions about how Python works and the reasons for design choices such as allowing duplicate function or method definitions, please try Python-List at python.org, or a forum such as Reddit /r/python.

Thank you.

-- Steve



More information about the Python-Dev mailing list