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

2018-01-14 Thread Ivan Levkivskyi
On 14 January 2018 at 08:20, Chris Angelico wrote: > On Sun, Jan 14, 2018 at 7:10 PM, joannah nanjekye > wrote: > > Hello, > > > > Apparently when you implement two methods with the same name: > > > > def sub(x, y): > > print(x -y) > > > > def

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

2018-01-14 Thread Steven D'Aprano
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):

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

2018-01-14 Thread Chris Angelico
On Sun, Jan 14, 2018 at 7:10 PM, joannah nanjekye wrote: > Hello, > > Apparently when you implement two methods with the same name: > > def sub(x, y): > print(x -y) > > def sub(x, y): > print(x -y) > > Even with type hints. > > def sub(x: int, y:int) -> int: >

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

2018-01-14 Thread joannah nanjekye
Hello, Apparently when you implement two methods with the same name: def sub(x, y): print(x -y) def sub(x, y): print(x -y) Even with type hints. def sub(x: int, y:int) -> int: return x - y def sub(x: float, y:float) -> float: return 8 If you are from another background,