even if it complains, it will work in some cases, but not yours.
and what you do by these two functions is actually
class Foo(): def bar(self): print('bar1') def bar(self): print('bar2') foo = Foo() foo.bar()
Output:bar2
However, given that this is part of class definition it doesn't make sense to have the first function - i.e. it will be overwritten by the second one in any case.and what you do by these two functions is actually
def do_work(self, name): some_object = self._map[name] # from here work with some_object