# 初始化方法
def __init__(self): # 直接呼叫, representation def __repr__(self): # 使用print會呼叫 def __str__(self):
# 迭代方法
def __iter__(self): ex. for i in xrange(1000): pass #返回迭代對象 參考迭代: http://puremonkey2010.blogspot.com/2016/05/python-python-yield.html
def __iter__(self):
ex.
張貼留言
沒有留言:
張貼留言