def run(b):
    b.f()
    b.g()
    b.h()
    b.g()

b = State_d(Implementation1())
run(b)


b.changeImp(Implementation2())
run(b)

b.foo = 100

b.foo

b = State_d(Implementation1())
run(b)

"""
Explanation: http://python-3-patterns-idioms-test.readthedocs.io/en/latest/Fronting.html
End of explanation
"""


try:
    b.foo
except:
    print("no implementation")

"""
Explanation: Expected -- no attribute foo in Implementation1.
End of explanation
"""


