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