简体   繁体   中英

Pycharm Intellisense no working on new class

In Pycharm, I create a new python class with properties:

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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