PyCharm Edu 3.5 Help

Basic Code Completion. Completing Names and Keywords

On this page:

Basics

Basic code completion helps you complete the names of classes, methods, and keywords within the visibility scope. When you invoke code completion, PyCharm Edu analyses the context and suggests the choices that are reachable from the current position of the caret.

If basic code completion is applied to a part of a parameter, or variable declaration, PyCharm Edu suggests a list of possible names with regard to the type of the item.

Invoking Basic code completion for the second time shows the names of classes, functions, modules and variables.

Code completion covers supported file types and custom file types. However, PyCharm Edu does not recognize the structure of custom file types and suggests completion options regardless of whether a specific type is appropriate in the current context.

Completing names

To automatically complete names in the current visibility scope, follow these general steps:

  1. Type a name or a part of a name.

    While typing, use the following techniques:

    • Narrow down the suggestion list by typing any part of a word, even the characters somewhere in the middle, or invoking code completion after a dot separator. PyCharm Edu will show suggestion list that includes occurrences with all the possible positions of the entered characters.

      This makes the use of the asterisk wildcard unnecessary:

      /help/img/idea/2017.1/python_asteriskLookupList.png
    • In case of CamelCase or snake_case names, type the initial letters only. So doing, PyCharm Edu automatically recognizes and matches the initial letters.
  2. Press Ctrl+Space.

    The images below show basic code completion for the following cases:

    • Methods:
      /help/img/idea/2017.1/python_CompletingMethod.png
    • Dictionaries:
      /help/img/idea/2017.1/python_CompletingDicts.png
  3. If necessary, press Ctrl+Space for the second time.

    This shows the names of classes, functions, modules and variables.

    /help/img/idea/2017.1/python_class_name_completion.png
  4. Select the desired class from the suggestion list, and do one of the following:
    • Press Enter or double-click the desired choice .
    • Press Tab .

Tips and tricks

  • If a suggestion list shows n variants of a class, type a dot, and the next suggestion list after dot will show all the possible qualified names of the members. After selecting the desired one, import statement will be added automatically.
  • Suggestion list includes literals, already defined in a file.

See Also

Last modified: 31 July 2017