I've just added leoSTC.py (Static Type Checking) to Leo's core.

This contains slightly modified code from the static-type-checking project: 
https://groups.google.com/forum/#!forum/python-static-type-checking.  
However, the intention is to provide code-analysis tools for routine tasks 
such as refactoring.

For example, no type analysis is needed to rename class name A to class 
name B provided that name A is defined only once and name B is not defined 
anywhere. In this (common) case, there is no need for fancy refactoring 
code: a script can do a global find/replace.  This should be of great help 
in converting all class names to pep8 style.

The code in leoSTC will allow global dictionaries of uses and definitions 
of all names to be computed very quickly: in about one second for all of 
Leo's files.  These dictionaries will tell us whether refactorings can be 
done with find/replace, or whether the full capabilities of a refactoring 
package such as Rope will be needed.

I have also begun exploring Rope: http://rope.sourceforge.net/  For 
instance, here is a newbie question and reply: 
https://groups.google.com/forum/#!topic/rope-dev/dhoaqLw3GMk

Rope already does static type checking sufficient to rename, for example, a 
member m of class A but not members of class B (which also has a member 
named m).  In other words, Rope already *has* static type checking (as does 
pylint), so it seems to me that the best way forward is simply to use Rope 
to do refactoring in Leo.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to