tool to check whether formal and actual parameters have similar names

Amir Michail amichail at gmail.com
Tue Aug 10 11:12:11 CEST 2004


Hi,

I was wondering if there is a tool that will perform some heuristic
checking of actual and formal parameters to warn about likely errors.

Such a tool could check that formal and actual parameters have similar
names.

For example:

def plot(x,y): ...

plot( x1, y1 ) # ok

plot( y1, x1 ) # not ok, but this is ok:  plot (x=y1, y=x1)

plot (1, y) # not ok, but this is ok: plot(x=1, y)

We can take this further:

avg = x1 + x2
plot( avg, y) # ok since avg gets name x from x1, x2

Does this make any sense, even in a heuristic sense?
Does such a tool already exist?  Would it be useful?

Amir




More information about the Python-list mailing list