On Tue, Sep 28, 2010 at 3:46 AM, Emile Anclin <[email protected]> wrote:
> Usually, pylint / astng will have to parse most of the Python Standard > Library (which is around 20 Mb) on any bigger project (such as a > framework); plus the site-packages on my current workstation are around > 100 Mb. (rough estimations based on 'du' and considering that the size > of .pyc files are similar to the .py) > > Given that, I am afraid we will have ~ 400 Mb for the only astng dumbs. > So that seems to be the wrong road... > > Edward K Ream, did you have other ideas in mind to handle the problem ? I've forgotten much of the previous discussion, but as I have often said before, forgetting can be a *good* thing when inventing. Of course, one must be prepared to say nonsense from time to time as the result :-) With that in mind, my idea is that the Python Standard Library would best be viewed as a source of information, a *known quantity*. We want to cache just that known quantity, in the form best suited for the rest of pylint/inc-lint. It doesn't much matter how long it takes to create this known quantity: it can be done once per "installation", whatever that means. In other words, inc-lint won't be trying to deduce the types of the objects in the standard library, we assume that the library isn't going to change. In fact, we might issue a warning if some other module implies a change to the library :-) Because the types of the objects in the library can be assumed to be immutable, there should be no point to caching ast's of the standard library. We want to cache only the "good stuff", the stuff that may be of use to inc-lint in analyzing the non-library part of the program being analyzed. This "good stuff" encodes (somehow) the deductions that can be made about the library. For example, we want to be able to infer that if s is a string, then s.strip() is also a string. We don't need the ast for string.py for that. Of course, s.strip() is different from string.strip(s), but the idea is the same. HTH Edward _______________________________________________ Python-Projects mailing list [email protected] http://lists.logilab.org/mailman/listinfo/python-projects
