We know that python is a dynamic language. If the type of the return value cannot be known, pycharm will not be able to recognize the type of the return value, so code completion will not be possible. The following is how to solve this problem.
question
Code cannot be completed
Solution
1. For a single return value
Add as follows
""":type:返回值类型"""
Example:
or
add as follows
#type:返回值类型
example:
Second, for multiple return values
assert isinstance(返回的对象, 对象类型)
Or
select the object to be typed and press alt+enter to display a window, select Add type hint for variable 'xxx'.
The following code appears,
just change the object to a certain type