Go To --> Implementation Problem


I'm a professional python developer, and I've been eagerly wanting to get into using PyCharm over Eclipse for various environmental/productivity reasons. During my trial, I've been having some issues with following imports to their implementation.

A quick look at a piece of my project workspace:
  | — django/
  | — mycode/

An example (from within mycode/):

from django.http import HttpResponse

When right clicking on HttpResponse, selecting Go To –> Implementation(s), nothing happens. However, if I follow the same steps on http in "from django.http", the file is properly opened. It seems odd to me that the file is known, yet I'm unable to jump to the function declaration. Every import I try has the same problem. Am I configuring something incorrectly?

Any help would be much appreciated.

The shortcut you need is "Goto Declaration", not "Goto Implementation".
None of the "Go To"s actually do anything when trying to follow a "from" import.
Update: PyCharm 2.7 allows me to follow declarations, with one exception:
from xxxx import yyyy as zzzz

I can follow xxxx and yyyy, but not zzzz.
That's normal behavior. zzzz is not a reference to anything, it's a local declaration of the name.
Really? Hm. Definitely seems strange to me, because following a usage of zzzz() will jump to the declaration of yyyy.
Why is it strange? This import statement defines a local name "zzzz" which is an alias for the imported name "yyyy". A usage of "zzzz" navigates to the imported element, which is "yyyy". Goto Declaration on "zzzz" doesn't do anything, just as Goto Declaration on a "def foo()" doesn't do anything: you're already on a declaration.
Makes sense. With that logic, why then doesn't the "go-to declaration" jump to the "as zzzz" import declaration?
Because we consider it to be less useful than jumping to the original definition.

Please sign in to leave a comment.