# HG changeset patch # User Paul Boddie # Date 1475271534 -7200 # Node ID 8bd8f2d412d870c159a438a11cf017c523e92b28 # Parent fab0f521eeb9210c7403cc7526d5ac1394e110f6 Fixed anonymous access bases in access plans. Renamed variables for clarity in get_access_plan. Added an example of anonymous accessing. diff -r fab0f521eeb9 -r 8bd8f2d412d8 deducer.py --- a/deducer.py Fri Sep 30 17:40:53 2016 +0200 +++ b/deducer.py Fri Sep 30 23:38:54 2016 +0200 @@ -394,7 +394,8 @@ for location in locations: base, traversed, attrnames, method, test, attr = self.access_plans[location] - print >>f_attrs, encode_access_location(location), base, \ + print >>f_attrs, encode_access_location(location), \ + base or "{}", \ ".".join(traversed) or "{}", \ ".".join(attrnames) or "{}", \ method, test, \ @@ -1733,9 +1734,9 @@ const_access = self.const_accesses_rev.has_key(location) - path, name, attrname_str, version = location - attrnames = attrname_str.split(".") - attrname = attrnames[0] + path, name, attrnames, version = location + remaining = attrnames.split(".") + attrname = remaining[0] # Obtain reference and accessor information, retaining also distinct # provider kind details. @@ -1828,9 +1829,9 @@ attr = first(attrs) traversed.append(attrname) - del attrnames[0] - - if not attrnames: + del remaining[0] + + if not remaining: break # Update the last static attribute. @@ -1841,7 +1842,7 @@ # Get the next attribute. - attrname = attrnames[0] + attrname = remaining[0] attrs = self.importer.get_attributes(attr, attrname) # Where many attributes are suggested, no single attribute identity can @@ -1876,6 +1877,8 @@ (class_relative and "-class" or "") origin = None - return base or name, traversed, attrnames, method, test, origin + # Determine the nature of the context. + + return base or name, traversed, remaining, method, test, origin # vim: tabstop=4 expandtab shiftwidth=4 diff -r fab0f521eeb9 -r 8bd8f2d412d8 tests/chain.py --- a/tests/chain.py Fri Sep 30 17:40:53 2016 +0200 +++ b/tests/chain.py Fri Sep 30 23:38:54 2016 +0200 @@ -18,6 +18,10 @@ C.D.F.t = 234 return self.o.__len__ t = 123 + def u(self): + return self.o + def v(self): + return self.u().__len__ def main(): c = C