Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python

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

 

 

Python python RSS feed   Index | Next | Previous | View Threaded


himanshu.garg at gmail

Nov 27, 2009, 2:36 AM

Post #1 of 4 (201 views)
Permalink
How to Detect Use of Unassigned(Undefined) Variable(Function)

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
--
http://mail.python.org/mailman/listinfo/python-list


joncle at googlemail

Nov 27, 2009, 3:00 AM

Post #2 of 4 (184 views)
Permalink
Re: How to Detect Use of Unassigned(Undefined) Variable(Function) [In reply to]

On Nov 27, 10:36 am, "++imanshu" <himanshu.g...@gmail.com> wrote:
>     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.

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


marco at sferacarta

Nov 27, 2009, 3:06 AM

Post #3 of 4 (159 views)
Permalink
Re: How to Detect Use of Unassigned(Undefined) Variable(Function) [In reply to]

Jon Clements wrote:

> 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...

pyflakes. I use that one

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


himanshu.garg at gmail

Nov 27, 2009, 8:15 PM

Post #4 of 4 (174 views)
Permalink
Re: How to Detect Use of Unassigned(Undefined) Variable(Function) [In reply to]

On Nov 27, 4:06 pm, Marco Mariani <ma...@sferacarta.com> wrote:
> Jon Clements wrote:
> > pychecker returns "test.py:3: No global (o) found" for the above, and
> > can be found athttp://pychecker.sourceforge.net/
>
> > There's also pylint and another one whose name I can't remember...
>
> pyflakes. I use that one

Thanks for the replies. Was looking for just these.

Thank You,
++imanshu
--
http://mail.python.org/mailman/listinfo/python-list

Python python RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.