1.1 --- a/README.txt Fri Sep 25 00:35:17 2009 +0200
1.2 +++ b/README.txt Wed Sep 30 00:24:41 2009 +0200
1.3 @@ -205,3 +205,23 @@
1.4 could be costly. Another less ambitious solution might only involve the
1.5 optimisation of such internal method calls if an unambiguous target can be
1.6 resolved.
1.7 +
1.8 +Narrowing Type Candidates using Attribute Names
1.9 +-----------------------------------------------
1.10 +
1.11 +Within functions, it might be useful to record attribute accesses on local
1.12 +names and to collect the names in order to help resolve targets in the
1.13 +generated code. For example:
1.14 +
1.15 + def f(x, y):
1.16 + x.method(y)
1.17 + if x.something:
1.18 + ...
1.19 + return x.attr
1.20 +
1.21 +Here, the object referenced via x should have "method", "something" and "attr"
1.22 +as attributes. We could impose a test for a type providing these attributes at
1.23 +the earliest opportunity and then specialise the attribute accesses, perhaps
1.24 +also invocations, in the generated code. AttributeError occurrences would need
1.25 +to be considered, however, potentially disqualifying certain attributes from
1.26 +any optimisations, and control flow would also need to be considered.