1 Support slicing. This is difficult because __getitem__ has to handle integers and slice
2 objects differently. One could either just try and iterate over the argument and then
3 catch the AttributeError for integers, or one could test the instances first.
4
5 Support isinstance. Like slicing, the problem is dealing with the class or tuple input
6 to the function. A strict tuple check is permissible according to the CPython behaviour,
7 but an iterable would be more elegant (as would *args).
8
9 Local assignment detection plus frame re-use. Example: slice.__init__ calls
10 xrange.__init__ with the same arguments which are unchanged in xrange.__init__. There is
11 therefore no need to build a new frame for this call.
12
13 Consider attribute usage observations being suspended inside blocks where AttributeError
14 may be caught (although this doesn't anticipate such exceptions being caught outside a
15 function altogether).
16
17 Fix object table entries for attributes not provided by any known object, or provide an
18 error, potentially overridden by options. For example, the augmented assignment methods
19 are not supported by the built-in objects and thus the operator module functions cause
20 the compilation to fail. Alternatively, just supply the methods since something has to do
21 so in the builtins.
22
23 Consider type deduction and its consequences where types belong to the same hierarchy
24 and where a guard could be generated for the most general type.
25
26 Consider attribute merging where many attributes are just aliases for the same underlying
27 definition.
28
29 Consider merging the InspectedModule.store tests with the scope conflict handling.
30
31 Consider permitting multiple class alternatives where the attributes are all identical.
32
33 Support class attribute positioning similar to instance attribute positioning, potentially
34 (for both) based on usage observations. For example, if __iter__ is used on two classes,
35 the class attribute could be exposed at a similar relative position to the class (and
36 potentially accessible using a LoadAttr-style instruction).
37
38 Consider references to defaults as occurring only within the context of a particular
39 function, thus eliminating default value classes if such functions are not themselves
40 invoked.
41
42 Consider labelling _scope on assignments and dealing with the assignment of removed
43 attributes, possibly removing the entire assignment, and distinguishing between such cases
44 and unknown names.
45
46 Check name origin where multiple branches could yield multiple scope interpretations:
47
48 ----
49 try:
50 set # built-in name
51 except NameError:
52 from sets import Set as set # local definition of name
53
54 set # could be confused by the local definition at run-time
55 ----
56
57 Support __init__ traversal (and other implicit names) more effectively.
58
59 Check context_value initialisation (avoiding or handling None effectively).
60
61 __getitem__ could be written in Python, using a native method only to access fragments.
62
63 Consider better "macro" support where new expressions need to be generated and processed.
64
65 **** Constant attribute users need not maintain usage since they are already resolved. ****
66
67 Loop entry points should capture usage to update later assignments in the loop.
68 The continue and break statements should affect usage propagation.
69
70 Consider handling CallFunc in micropython.inspect in order to produce instances of specific classes.
71 Then, consider adding support for guard removal/verification where known instances are involved.
72 Consider handling branches of values within namespaces in order to support more precise value usage.