Page 1 of 1

Tip for Python users who edit with pydev on Eclipse

Posted: Mon Nov 09, 2009 9:46 pm
by Cayle
As of version 1.5, pydev warns about unused variables. This is a wonderful feature. Unfortunately, this wonderful feature also triggers on variables only used to iterate for loops. E.g.

Code: Select all

for j in range(0, rowsPerColumn):
There is a tip to get around this on this stack overflow thread.
By default, it looks like PyDev will hide unused variable warnings for any variables that have names beginning with "dummy", "_", or "unused".
So after a bit of refactoring, the pydev is happy with the following code and you will only get warnings about real potential problems.

Code: Select all

for dummyJ in range(0, rowsPerColumn):

Re: Tip for Python users who edit with pydev on Eclipse

Posted: Mon Nov 09, 2009 10:54 pm
by hallsofvallhalla
sweet thanks for the tip! I occasionally use Python still and I use Eclipse quite a bit for my G1 android development.