class Cat: pass
class Dog: pass
class Duck: pass

from generic.multidispatch import multidispatch

@multidispatch(Dog)
def sound(o):
  print("Woof!")

@sound.register(Cat)
def cat_sound(o):
  print("Meow!")

sound(Dog())
