# HG changeset patch # User Paul Boddie # Date 1351812961 -3600 # Node ID e341cf363eae3be2a9b239a5dd35e123ac9b5850 # Parent 69bb1e2b79a5f4593e4d1c35ade839fbe1785f2d Updated the "to do" list, adding notes about using instantiation to filter relevant types and attributes. diff -r 69bb1e2b79a5 -r e341cf363eae TO_DO.txt --- a/TO_DO.txt Fri Nov 02 00:34:27 2012 +0100 +++ b/TO_DO.txt Fri Nov 02 00:36:01 2012 +0100 @@ -76,7 +76,19 @@ types for a name, and the final set of names leading to such type deductions might be a useful annotation to be added alongside _attrcombined. - Update the reports to group identical sets of attribute names. + (Update the reports to group identical sets of attribute names.) + +Attribute usage on attributes might be possible if one can show that the expression of an +attribute access is constant and that the attribute target is also constant or only refers +to a single type. For example, in the sys module: + + stderr = file() + +If no work is done to associate the result of the invocation with the stderr name, then +one could instead at least attempt to determine whether stderr is assigned only once. If +so, it might be possible to record attribute usage on references to the name. For example: + + sys.stderr.write(...) # sys.stderr supports write -> {file, ...} Interface/Type Generalisation ----------------------------- @@ -99,7 +111,7 @@ **** Constant attribute users need not maintain usage since they are already resolved. **** -Self-related Usage +Self-Related Usage ------------------ Perform attribute usage on attributes of self as names, potentially combining observations @@ -137,13 +149,22 @@ Instantiation Deduction ----------------------- -Consider handling CallFunc in micropython.inspect in order to produce instances of specific classes. -Then, consider adding support for guard removal/verification where known instances are involved. For -example: +Consider handling Const in micropython.inspect in order to produce instances of specific +classes. Then, consider adding support for guard removal/verification where known +instances are involved. For example: l = [] l.append(123) # type deductions are filtered using instantiation knowledge +Handling CallFunc in a similar way is more challenging. Consider the definitions in the sys module: + + stderr = file() + +It must first be established that file only ever refers to the built-in file class, and +only then can the assumption be made that stderr in this case refers to instances of file. +If file can also refer to other objects, potential filtering operations are more severely +limited. + Frame Optimisations ===================