开发者

Bad auto completion with python on pydev?

I began learning and loving python about a month ago. Dive into python, django and now Tornado is the path i followed during this time. I chose pydev as an IDE since it seems to be th开发者_JAVA百科e most up to date and i wanted to come back to eclipse since i'm using Netbeans for php and Java.

My question is the following: When i write classes in php or java i declare my methods and properties. I instantiate them somewhere else and use them. The autocompletion works great for java and php but with python, it seems to be always suggesting me a bunch of garbage and never the real object's methods from the class i instantiated.

Is it the same for you ? Is it a limitation from pydev ? Am i doing something wrong ?

Thank you in advance for pointing me in a direction. Matthieu.


First make sure your interpreter is set up correctly.

Window | Preferences | Pydev | Interpreter - Python

I use cpython on linux so my interpreter is

  cpython      /usr/bin/python25

Under Libraries, make sure all the standard PYTHONPATH stuff is in there:

System Libs
  /usr/lib/python2.5
  /usr/lib/python2.5/site-packages
  /usr/lib/python2.5/wx-2.8-gtk2-unicode
  /usr/lib/python2.5/lib-tk
  /usr/lib/python25.zip
  etc....

You can also add any non standard paths here by clicking New Folder.

Do not add paths to your own source code though. These should come in when you configure a pydev projec, select a "src" folder and start making modules, see here.


Well, as you didn't say what 'garbage' is showing, it's a bit hard to guess, but I believe you mean the __hash__, __str__, etc from the object class (is that it?)

If that's the case, this has been dealt in the current nightly build (the '_' methods will still appear, but with lower priority, so, the methods you're probably more interested in are at the top)


Pycharm (http://www.jetbrains.com/pycharm/index.html) is much better than Pydev for auto completion, among other things.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜