pychecker question

Roman Suzi rnd at onego.ru
Mon May 13 09:29:46 EDT 2002


Hi!

I am pychecking my code and am getting lots of:

stable.py:210: Variable (path) used before being set
stable.py:210: Variable (split) used before being set
stable.py:224: Variable (strip) used before being set
stable.py:226: Variable (index) used before being set
stable.py:261: Variable (join) used before being set
stable.py:261: Variable (replace) used before being set

These are caused by from-import statements inside functions,
schematically:

def f(x):
  from m import y
  return y(x)

Is it really considered bad to use from-import inside function
definition? (I did it because I wanted to state clearly which 
functions I am using from there. And I do not want to use it 
at the module level, like that:

from m import y
def f(x):
  return y(x)

as I think it will increase the number of imports.

*

Another question. Is there any front-end to pychecker 
to show code in proper context and an ability to 
silence certain warnings just like I do in ispell
if I consider some word correct?

Sincerely yours, Roman A.Suzi
-- 
 - Petrozavodsk - Karelia - Russia - mailto:rnd at onego.ru -
 






More information about the Python-list mailing list