feat(base): sort serializable attributes (#198)

Sorts the serializable attributes before they are returned from
.get_serializable_attributes(). Prevents the object id to change if the
order of the member names from .get_member_names() changes.
This commit is contained in:
Morten Engen
2022-07-11 13:19:22 +02:00
committed by GitHub
parent 7484d8441b
commit 3e7d657e2e
+1 -1
View File
@@ -331,7 +331,7 @@ class Base(_RegisteringBase):
def get_serializable_attributes(self) -> List[str]:
"""Get the attributes that should be serialized"""
return list(set(self.get_member_names()) - self._serialize_ignore)
return sorted(list(set(self.get_member_names()) - self._serialize_ignore))
def get_typed_member_names(self) -> List[str]:
"""Get all of the names of the defined (typed) properties of this object"""