class Dog:

    def say(self):
        print('hau')


class Cat:

    def say(self):
        print('meow')
pet = Dog()
pet.say()
another_pet = Cat()
another_pet.say()
my_pets = [pet, another_pet]
for a_pet in my_pets:
    a_pet.say()
Python - how to implement virtual methods?