摘要:
class Singleton(object): def __new__(cls,*args,**kwargs): if not hasattr(cls,'_instance'): orig=super(Singleton,cls) cls._instance=orig.__new__(cls) return... 阅读全文
摘要:
Python的字符串格式化有两种方式: 百分号方式、format方式 百分号的方式相对来说比较老,而format方式则是比较先进的方式,企图替换古老的方式,目前两者并存。[PEP-3101] This PEP proposes a new system for built-in string for 阅读全文