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
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):
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:
>
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,