Code completion for custom binaries

Does code completion for custom binaries work?

Say we installed a package "uno" in lib\site-packages that was layed out something like this:

uno
    __init__.py
        (has: __all__ = [dos, tres])
    _uno.pyd
    dos.py
        (has: from _uno import *)
    tres.py

If I then do  import uno._uno as x  then code completion works and my _uno goodies show up when I type x. (x dot).

However, if I do  import uno.dos as x  then code completion for x. (x dot), none of the _uno goodies show up --- just the items explicitly defined within dos.py.

Leaving PyCharm and going straight to the Python interpretter, if I do  import uno.dos as x  then I do get all the _uno goodies in the x namespace (due to the from _a import * statement in b.py) along with the items explictly defined within dos.py.

To get the benefits of code completion in PyCharm, it appears I have to do both of these:

import uno._uno as x1

import uno.dos as x2

Are there any settings I have to enable to do import uno.dos as x  and get both the _uno and dos goodies in the x namespace instead of the separate x1 and x2 namespaces?

Cheers,

Rob

3 comments
Comment actions Permalink

In PyDev, the code completion works great for  import uno.dos as x  import, so I am guessing that I need to somehow tweak the preferences in PyCharm.

Not certain if it helps, but I am using Windows 7 Professional, 64-bit, though with the Win32 version of Python --- and both PyDev and PyCharm are pointing to the same Python 2.6.5 interpreter and set of packages.

0
Comment actions Permalink

Hello Rob,

This functionality is broken in PyCharm beta 1, but it will work correctly

in beta 2.

Does code completion for custom binaries work?

Say we installed a package "uno" in lib\site-packages that was layed

out something like this:

uno

__init__.py

(has: __all__ = )

_uno.pyd

dos.py

(has: from _uno import *)

tres.py

If I then do  import uno._uno as x  then code completion works and my

_uno goodies show up when I type x. (x dot).

However, if I do  import uno.dos as x  then code completion for x. (x

dot), none of the _uno goodies show up --- just the items explicitly

defined within dos.py.

Leaving PyCharm and going straight to the Python interpretter, if I do

import uno.dos as x  then I do get all the _uno goodies in the x

namespace (due to the from _a import * statement in b.py) along with

the items explictly defined within dos.py.

To get the benefits of code completion in PyCharm, it appears I have

to do both of these:

import uno._uno as x1

import uno.dos as x2

Are there any settings I have to enable to do  import uno.dos as x

and get both the _uno and dos goodies in the x namespace instead of

the separate x1 and x2 namespaces?

Cheers,

Rob

---

Original message URL:

http://devnet.jetbrains.net/message/5270802#5270802

--

Dmitry Jemerov

Development Lead

JetBrains, Inc.

http://www.jetbrains.com/

"Develop with Pleasure!"

0
Comment actions Permalink

Awesome and thanks for the good news Dmitry!

Rob

0

Please sign in to leave a comment.