简体   繁体   English

Pycharm Intellisense无法在新课程上工作

[英]Pycharm Intellisense no working on new class

In Pycharm, I create a new python class with properties: 在Pycharm中,我创建了一个具有属性的新python类:

class Item(object):
    def __init__(self):
        self._name = None

    @property
    def name(self):
        return self._name

    @name.setter
    def name(self, _name):
        self._name = _name

When I try to use this class in another file I import it like this: 当我尝试在另一个文件中使用此类时,我将其导入为:

from filename import Item

Then I try to use intellisense when I type something like this: 然后,当我输入如下内容时,我尝试使用智能感知:

item = Item()
print(item.<ALT Enter>

I never get intellisense option for property name until it appears at least once in the file 在属性名称至少在文件中出现一次之前,我永远不会获得属性的intellisense选项

Is there anything I'm doing to the class definition that's muting the intellisense? 我对使智能感知静音的类定义正在做什么? Is there anything I can do help it? 有什么我可以帮忙的吗?

I had a method called get implemented. 我有一个名为得到实现的方法。 After removing (changing the name) everything worked fine. 删除(更改名称)后,一切正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM