human
What is a the Python program you requested given the following:
I am working on the file "20170913_python_decorator_contextmanager/decorator_and_contextmanager.ipynb".
The first task is:
到這邊你可能會疑惑這兩邊哪裡一樣？然後 yield 的東西呢？
其實你可以把 contextlib.contextmanager 視為一個轉換工具
Can you write Python program for it?
assistant
#Here is the Python program you requested.

@contextmanager
def my_context():
    print('do things in enter')
    yield 'It is a feature, not a bug!!!'
    print('do things in exit')

# 透過 contextmanager 轉換, 與下面這段程式碼等價

class my_context(object):
    def __enter__(self):
        print('do things in enter')
        return 'It is a feature, not a bug!!!'
    def __exit__(self, *excinfo):
        print('do things in exit')
        return 'exit'