# HG changeset patch # User Paul Boddie # Date 1489337188 -3600 # Node ID 66016f38e5a104a08eef2293d7bb8fffec3d310b # Parent 26f115c5ba503d7e96d66ce0b802936925f37627 Added a convenience method for getting attribute references. diff -r 26f115c5ba50 -r 66016f38e5a1 deducer.py --- a/deducer.py Sat Mar 11 23:42:48 2017 +0100 +++ b/deducer.py Sun Mar 12 17:46:28 2017 +0100 @@ -1631,9 +1631,7 @@ # Obtain attribute references for the access. - attrs = [] - for _attrtype, object_type, attr in self.referenced_attrs[access_location]: - attrs.append(attr) + attrs = self.get_references_for_access(access_location) # Separate the different attribute types. @@ -1703,9 +1701,7 @@ attrname = attrnames and attrnames[0] if attrname: - attrs = [] - for attrtype, object_type, attr in self.referenced_attrs[access_location]: - attrs.append(attr) + attrs = self.get_references_for_access(access_location) refs.update(attrs) # Alias references a name, not an access. @@ -1725,6 +1721,15 @@ self.referenced_objects[accessor_location] = refs + def get_references_for_access(self, access_location): + + "Return the references identified for 'access_location'." + + attrs = [] + for attrtype, object_type, attr in self.referenced_attrs[access_location]: + attrs.append(attr) + return attrs + def get_initialised_name(self, access_location): """