I have a problem with understanding the usage of "other" argument in the "greet" method.
I mean, I get it it's just an argument's name, but how does the python know what is the "other.name" as it is not defined anywhere in the method.
I'm confused because in normal function it would be enough just to call an argument "other", without any additional things, like ".name" in this particular case, to have the argument substituted with a value ("Emily").
When I tried to run it without ".name" it returned "Hello, CEO object at 0x7efdf8800f90 ".
Is it because "name" is a member variable and to read it I need to address it? but why?
Maybe the answer is "it is just the way it is" but I would really prefer to have a sensible answer to this:)
class Employee(object): def __init__(self, name): self.name = name def greet(self, other): print "Hello, %s" % other.name class CEO(Employee): def greet(self, other): print "Get back to work, %s!" % other.name ceo = CEO("Emily") emp = Employee("Steve") emp.greet(ceo) # Hello, Emily ceo.greet(emp) # Get back to work, Steve!