Is it possible to create getters and setters of a class field in PyCharm with any tool like in IntelliJ IDEA?
1 answer
If you mean @property and @.setter :
You can write props or propsd , and then press Tab
python is not java or c #. In python, there is no need to create heters and setters, unless you need some kind of custom logic when getting or saving a value. then @property and @.setter will help you.
Found a good example of how this can be used:
class Foo(object): def __init__(self, db): self.db = db @property def x(self): db.get('x') @x.setter def x(self, value): db.set('x', value) @x.deleter def x(self): db.delete('x') |