PyCharm 2025.2 Help

Advanced completion

Type-matching completion

Smart type-matching code completion filters the suggestion list and shows only the types applicable to the current context.

Invoke type-matching completion

  • Smart type-matching code completion filters the suggestion list and shows only the types applicable to the current context. To invoke type-matching completion, start typing your code and press Ctrl+Shift+Space. Alternatively, select Code | Code Completion | Type-Matching from the main menu.

Smart type completion

Statement completion

You can create syntactically correct code constructs by using statement completion. It inserts the necessary syntax elements and gets you in a position where you can start typing the next statement.

To invoke statement completion, start typing a code construct and press Ctrl+Shift+Enter.

Complete a method declaration

  • Start typing a method declaration and press Ctrl+Shift+Enter after the parenthesis.

    PyCharm automatically completes a method declaration with the mandatory parameter self. Start typing a method declaration in a Python class, and PyCharm will insert self after the opening bracket of the parameter list. This behavior is configurable on the Smart Keys page of the editor settings.

    class Art: def paint(#caret
    class Art: def paint(self): #caret

Complete a code construct

  • Start typing a code construct and press Ctrl+Shift+Enter.

    PyCharm automatically completes the construct and adds end. The caret is placed at the next editing position.

    def NewFunction#caret
    def NewFunction(): #caret

Complete statements in collections

  • PyCharm automatically inserts a trailing comma before a line break in multiline collection literals. In dict literals, it inserts a colon between a key and a value. Press Ctrl+Shift+Enter to invoke statement completion:

    my_dict = { "key": "value"#caret }
    my_dict = { "key": "value", #caret }

Hippie completion

Hippie completion is a completion engine that analyses your text in the visible scope and generates suggestions from the current context. It helps you complete any word from any of the currently opened files.

Expand a string at caret to an existing word

  1. Type the initial string and do one of the following:

    • Press Alt+/ or choose Code | Code Completion | Cyclic Expand Word to search for matching words before the caret.

    • Press Alt+Shift+/ or choose Code | Code Completion | Cyclic Expand Word (Backward) to search for matching words after the caret and in other open files.

    The first suggested value appears, and the prototype is highlighted in the source code.

  2. Accept the suggestion or hold the Alt key and keep pressing \ until you find the word you need.

23 September 2025