1.1 --- a/deducer.py Fri Sep 30 17:40:53 2016 +0200
1.2 +++ b/deducer.py Fri Sep 30 23:38:54 2016 +0200
1.3 @@ -394,7 +394,8 @@
1.4
1.5 for location in locations:
1.6 base, traversed, attrnames, method, test, attr = self.access_plans[location]
1.7 - print >>f_attrs, encode_access_location(location), base, \
1.8 + print >>f_attrs, encode_access_location(location), \
1.9 + base or "{}", \
1.10 ".".join(traversed) or "{}", \
1.11 ".".join(attrnames) or "{}", \
1.12 method, test, \
1.13 @@ -1733,9 +1734,9 @@
1.14
1.15 const_access = self.const_accesses_rev.has_key(location)
1.16
1.17 - path, name, attrname_str, version = location
1.18 - attrnames = attrname_str.split(".")
1.19 - attrname = attrnames[0]
1.20 + path, name, attrnames, version = location
1.21 + remaining = attrnames.split(".")
1.22 + attrname = remaining[0]
1.23
1.24 # Obtain reference and accessor information, retaining also distinct
1.25 # provider kind details.
1.26 @@ -1828,9 +1829,9 @@
1.27 attr = first(attrs)
1.28
1.29 traversed.append(attrname)
1.30 - del attrnames[0]
1.31 -
1.32 - if not attrnames:
1.33 + del remaining[0]
1.34 +
1.35 + if not remaining:
1.36 break
1.37
1.38 # Update the last static attribute.
1.39 @@ -1841,7 +1842,7 @@
1.40
1.41 # Get the next attribute.
1.42
1.43 - attrname = attrnames[0]
1.44 + attrname = remaining[0]
1.45 attrs = self.importer.get_attributes(attr, attrname)
1.46
1.47 # Where many attributes are suggested, no single attribute identity can
1.48 @@ -1876,6 +1877,8 @@
1.49 (class_relative and "-class" or "")
1.50 origin = None
1.51
1.52 - return base or name, traversed, attrnames, method, test, origin
1.53 + # Determine the nature of the context.
1.54 +
1.55 + return base or name, traversed, remaining, method, test, origin
1.56
1.57 # vim: tabstop=4 expandtab shiftwidth=4
2.1 --- a/tests/chain.py Fri Sep 30 17:40:53 2016 +0200
2.2 +++ b/tests/chain.py Fri Sep 30 23:38:54 2016 +0200
2.3 @@ -18,6 +18,10 @@
2.4 C.D.F.t = 234
2.5 return self.o.__len__
2.6 t = 123
2.7 + def u(self):
2.8 + return self.o
2.9 + def v(self):
2.10 + return self.u().__len__
2.11
2.12 def main():
2.13 c = C