coding utf-8 class TreeGenomMixin object def __unicode__ self return s

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# -*- coding: utf-8 -*-
class TreeGenomMixin(object):
def __unicode__(self):
return super(TreeGenomMixin, self).__unicode__() + u" with wooden leg"
class Cat(object):
def __unicode__(self):
return u"a cat"
class Dog(object):
def __unicode__(self):
return u"a dog"
class GeneticallyModifiedCat(Cat, TreeGenomMixin):
pass
class GeneticallyModifiedDog(TreeGenomMixin, Dog):
pass
cat = GeneticallyModifiedCat()
dog = GeneticallyModifiedDog()
print unicode(cat)
print unicode(dog)