Ensure we return the correct values for dir().

This commit is contained in:
Mike Auty
2018-06-16 14:29:51 +01:00
parent c0ec52822b
commit d9ed86bcc5
+4
View File
@@ -633,6 +633,10 @@ class Struct(interfaces.objects.ObjectInterface):
return member
raise AttributeError("Struct has no attribute: {}.{}".format(self.vol.type_name, attr))
def __dir__(self) -> typing.Iterable[str]:
"""Returns a complete list of members when dir is called"""
return list(super().__dir__()) + list(self.vol.members.keys())
def write(self, value):
raise TypeError("Structs cannot be written to directly, individual members must be written instead")