1.1 --- a/micropython/common.py Sun Apr 28 19:23:05 2013 +0200
1.2 +++ b/micropython/common.py Sun Apr 28 19:56:18 2013 +0200
1.3 @@ -86,7 +86,7 @@
1.4 try:
1.5 attributes.add(self.objtable.access(target.full_name(), attrname))
1.6 except TableError:
1.7 - return None
1.8 + pass
1.9
1.10 return attributes
1.11
1.12 @@ -129,47 +129,6 @@
1.13
1.14 return False
1.15
1.16 - def possible_accessor_types(self, node, defining_users=1):
1.17 -
1.18 - """
1.19 - Given annotations made during the inspection process, return all possible
1.20 - type names and indications of static usage for a 'node' involved in
1.21 - attribute access.
1.22 -
1.23 - If 'defining_users' is set to a false value, attempt to get the type
1.24 - names specifically applicable to the node, rather than retrieving more
1.25 - general definition-based type observations.
1.26 - """
1.27 -
1.28 - all_target_names = []
1.29 -
1.30 - # Where an attribute could already be detected and where its nature is
1.31 - # not that of a general instance or an unresolved name, attempt to
1.32 - # identify it.
1.33 -
1.34 - # Use explicit annotations on the node.
1.35 -
1.36 - attrs = self.possible_attributes_from_annotation(node)
1.37 - if attrs:
1.38 - target_names = set()
1.39 - for (attr, value) in attrs:
1.40 - # NOTE: Ignoring constant objects.
1.41 - if attr:
1.42 - target_names.add((attr.parent.full_name(), attr.is_static_attribute()))
1.43 - all_target_names.append(target_names)
1.44 -
1.45 - # Use attribute usage observations.
1.46 -
1.47 - target_names = self.possible_accessor_types_from_usage(node, defining_users)
1.48 - if target_names:
1.49 - all_target_names.append(target_names)
1.50 -
1.51 - # Return the smallest set of target names.
1.52 -
1.53 - all_target_names.sort(key=lambda x: len(x))
1.54 -
1.55 - return all_target_names and all_target_names[0]
1.56 -
1.57 def possible_attributes_from_annotation(self, node):
1.58
1.59 """