-
I do this sort of refactoring all the time. I get very good & fast results simply using shell tools -- find, grep, sed. Especially with the case you mention, where you really need only change import statements, this is very adequate. I'm definitely -1 on integrated refactoring tools; I want it to be me that knows the code, not some Big Brother of an IDE. If I run into problems, that means my shell chops aren't good enough, and if I relied on a refactoring tool, they wouldn't get better. (With languages like Java, OTOH, I don't particularly want to know it, so getting a behemoth like Eclipse to perform such tasks is more attractive!)
-
"grep -w" will find Foo or module.Foo but not find FooHandler, which seems what you want.
Using some coverage tool in addition to your test suite, to make sure that all lines of code have been exercised, should make you 100% confident that simple import errors won't happen in production.
-
I dunno how stable BRM is, but I'd try to use it.
But I don't see the statically typed thing as relevant, what you really need is
- a good tool
- a good test suite
The former is probably not available for python, but it is for every smalltalk out there (and ST is quite dynamic ;), the latter is up to you.
My approach is to change the obvious stuff, run the test suite, get some error and fix them and go on till evrything passes again. Almost the same than fail compilation/change/recompile
-
Static typing allows one to predict accurately what the program will do, what <@x.y@> exactly refers to, etc. Tools like Eclipse put this to good use. It's not (always) possible in languages like Python where expressions like <@x.y@> aren't resolved until they are actually executed. So one needs a different approach there. Test suites are very suitable, as you already mentioned.
Smalltalk is a different bowl of soup altogether... I believe the Smalltalk refactoring browsers work with live objects, rather than code in a text file. But I could be wrong; I haven't actually used a real Smalltalk system, much less a refactoring browser for it.
-
That should have been x.y, etc...
-
Ever hear of PyChecker? Good tool. Never refactor without it.
-
I think Bicycle Repair Man would be the way to go. Admittedly, I've only used it on a codebase with ~20 modules, but it performed flawlessly. Recommended.
-
The eric3 IDE provides refactoring based on Bicycle Repair Man.
Not the only reason to work with it.