0

I'm using PyDev 6.0.0 under Eclipse Neon, and I find that PyDev doesn't find the source for some modules.

For example, when using wxPython, when I edit a source file that contains:

mylist = wx.ListCtrl(parent, ID)

If I hover over ListCtrl, I only see:

ListCtrl.__init__ found at wx.__init__

and in wx.init has:

# Import all items from the core wxPython module so they appear in the wx
# package namespace.
from wx.core import *

# Clean up the package namespace
del core
del wx

So, ListCtrl is really in wx.core but imported into wx.

PyDev can't provide code completion, or doc hover help, etc. etc for this kind of structure.

Is there anyway to configure around this problem? I'm new to the wxPython library and it would really be nice to have IDE support for it.

  • BTW: "wx" and "wxPython" are already listed in "Forced Builtins". – Kirk Wolf Oct 26 '17 at 16:11
  • Correction: code completion mostly works, but doc hover or the ability to just F3 to the code does not work – Kirk Wolf Oct 28 '17 at 16:47
  • It's expected that doc hover and F3 aren't properly provided (because wx code is mostly inside a dll compiled from C/C++, so, PyDev doesn't really have the sources to go to). – Fabio Zadrozny Oct 29 '17 at 09:45
  • No, the sources are available. In the case of the wx package, the sources are actually in wx.core. When I import other packages like wx.lib.mixins the source is found just fine. – Kirk Wolf Oct 30 '17 at 13:21

1 Answers1

0

You will almost certainly have to create stubs for it. Because wxPython is a wrapper around C++, it can be harder for some IDEs to autocomplete. I think Wingware and PyCharm work though. See the following for more information on creating stubs:

I think it may be a bug in PyDev though:

The bug tracker for PyDev is not very friendly, so I wasn't able to actually find a bug number for you.

Mike Driscoll
  • 32,629
  • 8
  • 45
  • 88
  • It definitely works in PyDev... the problem seems to be in hover and F3 which isn't really possible due to wx not having sources in Python to go to (and the bindings seem to be a bit on the poor side and don't provide __doc__ in the exported symbols, so, there are no docstrings either). – Fabio Zadrozny Oct 29 '17 at 09:50
  • Good to know. I wonder how they could make their project more friendly to IDE autocomplete – Mike Driscoll Oct 30 '17 at 16:54