1.1 --- a/TO_DO.txt Fri Nov 02 00:34:27 2012 +0100
1.2 +++ b/TO_DO.txt Fri Nov 02 00:36:01 2012 +0100
1.3 @@ -76,7 +76,19 @@
1.4 types for a name, and the final set of names leading to such type deductions might be a
1.5 useful annotation to be added alongside _attrcombined.
1.6
1.7 - Update the reports to group identical sets of attribute names.
1.8 + (Update the reports to group identical sets of attribute names.)
1.9 +
1.10 +Attribute usage on attributes might be possible if one can show that the expression of an
1.11 +attribute access is constant and that the attribute target is also constant or only refers
1.12 +to a single type. For example, in the sys module:
1.13 +
1.14 + stderr = file()
1.15 +
1.16 +If no work is done to associate the result of the invocation with the stderr name, then
1.17 +one could instead at least attempt to determine whether stderr is assigned only once. If
1.18 +so, it might be possible to record attribute usage on references to the name. For example:
1.19 +
1.20 + sys.stderr.write(...) # sys.stderr supports write -> {file, ...}
1.21
1.22 Interface/Type Generalisation
1.23 -----------------------------
1.24 @@ -99,7 +111,7 @@
1.25
1.26 **** Constant attribute users need not maintain usage since they are already resolved. ****
1.27
1.28 -Self-related Usage
1.29 +Self-Related Usage
1.30 ------------------
1.31
1.32 Perform attribute usage on attributes of self as names, potentially combining observations
1.33 @@ -137,13 +149,22 @@
1.34 Instantiation Deduction
1.35 -----------------------
1.36
1.37 -Consider handling CallFunc in micropython.inspect in order to produce instances of specific classes.
1.38 -Then, consider adding support for guard removal/verification where known instances are involved. For
1.39 -example:
1.40 +Consider handling Const in micropython.inspect in order to produce instances of specific
1.41 +classes. Then, consider adding support for guard removal/verification where known
1.42 +instances are involved. For example:
1.43
1.44 l = []
1.45 l.append(123) # type deductions are filtered using instantiation knowledge
1.46
1.47 +Handling CallFunc in a similar way is more challenging. Consider the definitions in the sys module:
1.48 +
1.49 + stderr = file()
1.50 +
1.51 +It must first be established that file only ever refers to the built-in file class, and
1.52 +only then can the assumption be made that stderr in this case refers to instances of file.
1.53 +If file can also refer to other objects, potential filtering operations are more severely
1.54 +limited.
1.55 +
1.56 Frame Optimisations
1.57 ===================
1.58