mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-01 13:14:52 +00:00
Skip attributes with leading underscore in Object.__eq__
This commit is contained in:
parent
20c6b959d5
commit
57a4897470
1 changed files with 3 additions and 0 deletions
|
|
@ -88,6 +88,9 @@ class Object:
|
|||
def __eq__(self, other: "Object") -> bool:
|
||||
for attr in self.__dict__:
|
||||
try:
|
||||
if attr.startswith("_"):
|
||||
continue
|
||||
|
||||
if getattr(self, attr) != getattr(other, attr):
|
||||
return False
|
||||
except AttributeError:
|
||||
|
|
|
|||
Loading…
Reference in a new issue