PyDev/Eclipse formatter

1,458 views
Skip to first unread message

atulDOTkhotATGmailDOTcom

unread,
Dec 19, 2013, 12:16:23 AM12/19/13
to pytho...@googlegroups.com
Dear all,
     Being an eclipse guy - I tinker with python using Aptana Pydev...
It is a very nice one btw...

Somehow when I copy some code snippet - a quick Shift+Ctrl+F does nothing
(the key is bound correctly to format code)...
     I like any code properly formatted - and for python it is anyway required 

Anyone using the same environ - know what I could be missing? 

--- cheerio atul

atulDOTkhotATGmailDOTcom

unread,
Dec 19, 2013, 12:33:49 AM12/19/13
to pytho...@googlegroups.com

Imran Ahmed

unread,
Dec 19, 2013, 1:31:20 AM12/19/13
to pytho...@googlegroups.com
Even I use  Aptana Pydev in eclipse. Shift+Ctrl+F works for me.

atulDOTkhotATGmailDOTcom

unread,
Dec 19, 2013, 2:20:38 AM12/19/13
to pytho...@googlegroups.com
Hi Imran,
        Thanks for your note! The stack overflow post made me think it is a tough feature to support. 
         However, I pasted the code in vim(version 7.3.429):
doing gg=G does a much better job...
         Pydev formatting does not work for me though... 
The Ctrl+1 quickfix also sadly does not understand the <INDENT> error...
(The funny thing is while keying in the code - it does the right thing) - Let me update the plugin and see...
         
  
            

--- cheerio atul



On Thu, Dec 19, 2013 at 12:01 PM, Imran Ahmed <imranah...@gmail.com> wrote:
Even I use  Aptana Pydev in eclipse. Shift+Ctrl+F works for me.

--
You received this message because you are subscribed to the Google Groups "Python Pune" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pythonpune+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Mandar Vaze / मंदार वझे

unread,
Dec 25, 2013, 12:51:24 PM12/25/13
to pytho...@googlegroups.com
May not be the answer you are looking for - but have you tried PyCharm ?

I had tried PyDev few years ago - it was too heavy (memory hog/slow) for me. Went back to vim.
when PyCharm released community edition, I gave it a try, and believe me it has become my primary IDE
It supports vim keybindings is an icing on the cake

-Mandar



atulDOTkhotATGmailDOTcom

unread,
Dec 30, 2013, 6:23:56 AM12/30/13
to pytho...@googlegroups.com
Thanks Mandar for the pointer! I downloaded it - as I see this is a jetbrains offering...
Their Java IDE was revered by many... 
     I will try and adopt it - I love PyDev too - PyDev's unit testing support seems so similar to Junit - and that is just great - just keep the bar going green spirit ;-)
     OTOH I thought about "why the IDEs can't do much w.r.t. auto-indentation" theme - and it is making sense - for example,
how would an IDE know that it should decrease the indend of the following:

class TypedList:
...
    def __getitem__(self, i):
       return self.elements[i]  # rest of the code snipped
# Here - how does the ide know about the python idiom  __name__ == "__main__"???
# and decrese the indent? 
if __name__ == "__main__":
    import doctest
    doctest.testmod()

This is arguable - but I think I kind of understand why PyDev may not handle it...


--- cheerio atul

Prahalad Deshpande

unread,
Dec 31, 2013, 2:32:52 AM12/31/13
to pytho...@googlegroups.com
Interesting discussion! :-). When I was a novice python guy and even now .. I wonder and yearn for a really smart Python IDE (on the lines of Visual Studio or what Jetbrains/Eclipse have for Java) which supports stuff like refactoring, extracting methods from code - automatic renaming of classes within a package etc...

Having said that I definitely vote for PyDev/Aptana as a mature Python IDE - I haven't tried PyCharm. :-(.

Also my personal ( and possibly incorrect) opinion  on Atul's interesting question about IDE recognizing the correct indentation - I think auto-indentation of a line of code takes place based on the context surrounding that line( whether the line is a part of a method body or that of a condition etc..). But to achieve absolutely correct indentation, merely understanding surrounding context is not enough - the intent also needs to be understood.  Hence for e.g. in the code snippet provided by Atul above, the programmer may actually want to perform the check if __name__ == "__main__"  within one of the class methods and execute some debugging logic. What this means that the final responsibility for specifying the correct context in which a line of code is the responsibility of the programmer and IDEs would probably want to keep it that way.


Thanks
-Prahalad
Reply all
Reply to author
Forward
0 new messages