python适配器模式
class A:
def cost(self):
print('cost a')
class B:
def cost(self):
print('cost b')
class MyAdapter:
def __init__(self, obj):
self.obj = obj
def pay(self):
self.obj.cost()
adt_a = MyAdapter(A())
adt_a.pay()
adt_b = MyAdapter(B())
adt_b.pay()