# HG changeset patch # User Paul Boddie # Date 1352071329 -3600 # Node ID 37db6f8916c7e15d60af28c799f9f38ed46308fd # Parent b7fe1463a3c62519ab798790ae1fa748b6f66ce8 Moved the instantiation-related activities out of the attribute usage section. Added notes about deductions employing invocation observations. diff -r b7fe1463a3c6 -r 37db6f8916c7 TO_DO.txt --- a/TO_DO.txt Mon Nov 05 00:07:54 2012 +0100 +++ b/TO_DO.txt Mon Nov 05 00:22:09 2012 +0100 @@ -146,25 +146,6 @@ except AttributeError: z = None -Instantiation Deduction ------------------------ - -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 =================== @@ -182,11 +163,36 @@ attribute, or passed to another function or method might, if such observations were combined, allow frame-based or temporary allocation to occur. -Instantiation -============= +Instantiation Deduction +======================= + +Consider handling Const, List and Tuple 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 + +Currently, this is done only for Const values in the context of attribute accesses during +inspection. + +Handling CallFunc in a similar way is more challenging. Consider the definitions in the sys module: -Specific instances could be produced, providing type information and acting somewhat like -classes during inspection. + 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. + +Invocation-Related Deduction +============================ + +Where an attribute access (either in conjunction with usage observations or independently) +could refer to a number of different targets, but where the resulting attribute is then +used in an invocation, filtering of the targets could be done to eliminate any targets +that are not callable. Guards would need introducing to prevent inappropriate operations +from occurring at run-time. Inlining ========