My problem is not about passing, i just want to know how it still works when name is not defined.
class Animal(object): """Makes cute animals.""" is_alive = True # def __init__(self, name, age): # self.name = name # self.age = age !!So i erased theese 3 rows!! def description(x): print x.name print x.age description(hippo) hippo = Animal("asd", 5)
The thing i don't understand is it still prints "asd 5" after i erased 3 rows where name and age is defined.
So how does python knows about meaning of x.name when there is no "self.name = name" or init row and they are not defined?