As I worked out in the pool today many thoughts came together. 1. The essence of pylint is type inference. In this respect pylint is, or should be, like a global optimizing compiler.
2. The recent pep8 work isn't bad, but the essence of pylint is, or should be, flow graphs. We want graph-like algorithms presented cleanly, without reference to ast's. It may be time for a complete re- visioning of both pep8 and pylint. 3. We can define the notion of *type cleanliness*. A program or fragment is *type clean* if the ranges of types of all names in the program or fragment can be deduced. The Aha: the inability to infer types is **useful data**. We could imagine driving pylint (or development itself) so that more and more of a program becomes type clean. For example, it would be extremely helpful within Leo to know those situations in which c, p, s and v were not of the expected types. It would also be interesting to discover which of Python's standard modules are type clean. To repeat: a rewrite of pylint should be based on flow graphs. Algorithms involving such graphs should be as clean as algorithms on Leo outlines. We need a new infrastructure geared to type inference and flow graphs. In this light, 2to3 and pylint are found wanting. Pyrex attempts to deduce and use sets of known types. I know from previous study that pyrex solves a lot of non-obvious problems. It may be time to study pyrex again to see what the hidden pitfalls are. The Aha will drive the design of the new pylint. Indeed, we must think in reverse. Instead of going from syntax to ast's to warnings, we will want to go from flow graphs to non-trivial inferences. I suspect I shall be spending considerable time in the next year on this project. I see now that the pep8 work, while interesting, has been focused on preliminaries. The task now is to create the flow graph world. It's what matters. Edward -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/leo-editor?hl=en.
