标签:monkeypatching
-
Python3-在__eq__方法中使用super()会引发RuntimeError:super():__class__单元格未找到 - python
我是猴子修补类的__eq__方法。我发现以下作品: def eq(obj, other): if isinstance(other, str): return obj.name.upper() == other.upper() else: return object.__eq__(obj, other) 这不起作用: def eq(obj, other): […]