摘要: 下述使用myDecorator的__call__方法替换aFunction:class myDecorator(object):def __init__(self, f):print("inside myDecorator.__init__()")f() # Prove that function ... 阅读全文
posted @ 2015-06-30 20:32 Edisonxiang 阅读(119) 评论(0) 推荐(0) 编辑
摘要: Logger子类:import logging# create loggermodule_logger = logging.getLogger('spam_application.auxiliary')class Auxiliary: def __init__(self): se... 阅读全文
posted @ 2015-06-30 20:09 Edisonxiang 阅读(180) 评论(0) 推荐(0) 编辑