摘要:
原因:点__class__时,漏写了后面两个下划线 if data.__class.__base__ is not Optional: AttributeError: 'WhereOptional' object has no attribute '_Optional__class' 正确: if 阅读全文
摘要:
原因:内嵌装饰函数没有返回结果 def match_error(func): """2020-06-06 00:29:05 根据数据选择分支""" def _match_error(self, *args, **kwargs): return self.match(lambda x: self, l 阅读全文
摘要:
原因:new方法没有返回实例,导致创建实例结果为None @staticmethod def __new__(cls, *args, **kwargs): """抽象类""" # 2020-06-05 20:40:13 if cls is __class__: # 2020-06-06 00:57: 阅读全文