Alexander Zatvornitskiy wrote:

Another example. Let say you have variable PowerOfGenerator in your program.
But, it is only active power, so you have to (1)rename PowerOfGenerator to
ActivePowerOfGenerator, (2)calculate ReactivePowerOfGenerator, and (3)calculate
new PowerOfGenerator by formula
  PowerOfGenerator=sqrt(ReactivePowerOfGenerator**2+ActivePowerOfGenerator**2)
With var declarations, on step (1) you just rename PowerOfGenerator to
ActivePowerOfGenerator in the place of its declaration, and compile your
program. Compiler will show you all places where you have to rename variables.
After it, on step (3) you can safely and peacefully add new PowerOfGenerator
variable.

You can also get all places where said variable exists by using grep, or your editor's search feature. I don't see how a var declaration gains you anything over 'grep PowerOfGenerator *.py' ...


Jeff Shannon
Technician/Programmer
Credit International


-- http://mail.python.org/mailman/listinfo/python-list

Reply via email to