# HG changeset patch # User Paul Boddie # Date 1529858619 -7200 # Node ID fc7f612df68dc5d834410e5f025ec3c1a29f3b5d # Parent a8a16ef13733ec600c1680aeb9d909726a37cf0a Made use of available reference information in order to determine the nature of invocations and to avoid generic __invoke calls. diff -r a8a16ef13733 -r fc7f612df68d translator.py --- a/translator.py Sun Jun 24 00:57:47 2018 +0200 +++ b/translator.py Sun Jun 24 18:43:39 2018 +0200 @@ -1141,18 +1141,22 @@ attrnames = location.attrnames attrname = attrnames and attrnames.rsplit(".", 1)[-1] - # Determine any common aspects of any attribute. - - if attrname: + # Determine common aspects of any identifiable targets. + + if attrname or refs: all_params = set() all_defaults = set() min_params = set() max_params = set() - refs = set() + + # Employ references from the expression or find all + # possible attributes for the given attribute name. + + refs = refs or self.get_attributes_for_attrname(attrname) # Obtain parameters and defaults for each possible target. - for ref in self.get_attributes_for_attrname(attrname): + for ref in refs: origin = ref.get_origin() params = self.importer.function_parameters.get(origin) @@ -1164,7 +1168,6 @@ all_params.add(tuple(params)) min_params.add(len(params) - (defaults and len(defaults) or 0)) max_params.add(len(params)) - refs.add(ref) else: refs = set() break