2022年2月21日
摘要: class Test(object): __instance = None def __init__(self): print(" init方法 ") def __new__(cls): print(" new方法 ") if cls.__instance == None: cls.__instan 阅读全文
posted @ 2022-02-21 17:20 boye169 阅读(11) 评论(0) 推荐(0) 编辑
摘要: class InputException(Exception): '''自定义的异常类''' def __init__(self,length,atleast): self.length = length self.atleast = atleast def test_except(): try: 阅读全文
posted @ 2022-02-21 17:18 boye169 阅读(82) 评论(0) 推荐(0) 编辑