Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   How to Detect Use of Unassigned(Undefined) Variable(Function) (http://www.velocityreviews.com/forums/t706776-how-to-detect-use-of-unassigned-undefined-variable-function.html)

++imanshu 11-27-2009 10:36 AM

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

Jon Clements 11-27-2009 11:00 AM

Re: How to Detect Use of Unassigned(Undefined) Variable(Function)
 
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.


Marco Mariani 11-27-2009 11:06 AM

Re: How to Detect Use of Unassigned(Undefined) Variable(Function)
 
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


++imanshu 11-28-2009 04:15 AM

Re: How to Detect Use of Unassigned(Undefined) Variable(Function)
 
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


All times are GMT. The time now is 09:00 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.