?? proxydemo.py
字號:
#: c04:ProxyDemo.py
# Simple demonstration of the Proxy pattern.
class Implementation:
def f(self):
print "Implementation.f()"
def g(self):
print "Implementation.g()"
def h(self):
print "Implementation.h()"
class Proxy:
def __init__(self):
self.__implementation = Implementation()
# Pass method calls to the implementation:
def f(self): self.__implementation.f()
def g(self): self.__implementation.g()
def h(self): self.__implementation.h()
p = Proxy()
p.f(); p.g(); p.h()
#<hr>
output = '''
Implementation.f()
Implementation.g()
Implementation.h()
'''
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -