Home > Back-end >  Pycharm Code Completion does not work in methods or functions
Pycharm Code Completion does not work in methods or functions

Time:09-01

This is so weird... Code completion only works outside a method... Anyone know how to fix this?

enter image description here

enter image description here

CodePudding user response:

This is the way it should work, and it has nothing to do with being inside or outside a method or function.

Your function does not have enter image description here

Instead, if you put a type hint like text: str, then texts will be a List[str]:

enter image description here

and Pycharm's autocomplete will show its methods:

enter image description here

  • Related