How to Detect Use of Unassigned(Undefined) Variable(Function)

I

++imanshu

Is there a script/module to detect the use of unassigned
(undefined) variables(functions) in python. e.g. can I detect the
problem on line 3 automatically :-

i = 1
if i == 3:
print o
print i

Thank You,
++imanshu
 
J

Jon Clements

    Is there a script/module to detect the use of unassigned
(undefined) variables(functions) in python. e.g. can I detect the
problem on line 3 automatically :-

i = 1
if i == 3:
    print o
print i

Thank You,
++imanshu

pychecker returns "test.py:3: No global (o) found" for the above, and
can be found at http://pychecker.sourceforge.net/

There's also pylint and another one whose name I can't remember...

hth
Jon.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,052
Latest member
KetoBeez

Latest Threads

Top