Enhanced Go to Implementation presentation¶
Prepends the owning class name to the method name in the Go to Implementation popup whenever two or more candidates share the same short name, so overrides can be told apart at a glance.
In a typical Python codebase, multiple classes implement a method with the same name — for example, several services implementing process, or a hierarchy of handlers all overriding handle. When you invoke Navigate → Go to Implementation (⌥⌘B / Ctrl+Alt+B) on such a method, PyCharm shows the Choose implementation popup with one row per candidate.
Out of the box, every row renders only the method name plus the file it lives in:
This creates a concrete pain point: Speed-search cannot narrow the list. The popup's type-to-filter search only matches against the method/class name only, not the FQN. Since every row shows the same method name, typing ServiceA or UserHandler filters out all rows instead of focusing on the override you want.
BetterPy contributes a gotoTargetPresentationProvider for Python that rewrites the row presentation when — and only when — there is a disambiguation problem. For each candidate method whose short name collides with another candidate in the same popup, the presentation is changed to ClassName.methodName, while the file/location column is kept intact:
With the class name inline you can now Use speed-search to narrow down — typing ServiceB filters the list down to the matching row, because the class name is part of the row's searchable text.
Candidates whose short name is already unique in the popup are left untouched, so the presentation stays minimal and only adds information when it's actually useful.
How to invoke¶
Use the standard IDE action Navigate | Go to Implementation on a Python method with multiple implementation candidates. BetterPy adjusts the popup rows automatically when candidate names would otherwise be ambiguous.
Example¶
class CsvExporter:
def process(self) -> None:
...
class JsonExporter:
def process(self) -> None:
...
Invoking Go to Implementation on a shared process declaration can show rows such as:
Typing JsonExporter in the popup speed-search narrows the list to the JSON implementation.
What it supports¶
- Python Go to Implementation popups with duplicate method names.
- Keeping the file and location columns unchanged.
- Leaving already unique candidates untouched.
- Standard IDE keyboard and speed-search interaction.
What it deliberately avoids¶
- Changing source code, names, or navigation targets.
- Adding class names when they are not needed for disambiguation.
- Replacing the IDE's own implementation search.
Notes¶
- The feature is passive once enabled.
- The feature is gated by the Enhanced Go to Implementation presentation setting under Settings | BetterPy | IDE Customization | Presentation.