[EMAIL PROTECTED] schrieb: > Hi, > > many mistakes in programming arise when one changes the code and > forgets to adjustment somewhere where it is used. Is there a program > that can extract all place in the source code where a variable is > accessed or a function called? > For example in the simplest case I want to change the name of a > function everywhere in the source...
Others have given you answers that point to concrete, yet partial solutions to your problem. I just want to shed some light to the broader scope. There are limits to what can be done in a dynamic language like python. Lots of code (and very valuable one) in python lives from the fact that e.g. a = getattr(b, some_computed_name) works. So, ultimately you will always encounter situations where a simple name-replace won't catch all possible access/modification spots. So, a language like e.g. java together with an ide like eclipse shines in refactoring. The fun fact is: having the compiler grok your code means close to nothing - without proper testing, things can and will easily break. The answer to this is: testing, as automated as possible. And funny enough, that should (and will in most cases) catch whatever errors resulted from that renaming. So: use the mentioned tool, use pycheker and/or pylint to gain some pre-running confidence in code changes. But ultimately: test! Diez -- http://mail.python.org/mailman/listinfo/python-list