PyCharm 2019 - Auto-Generate Getters / Setters


I am trying to auto-generate getter/setter methods for my python classes.

In IntelliJ when I am writing Java I can do this:

public class Dog {
String name;
String breed;

(alt + insert) --> getters/setters --> select fields to generate...

However, in Pycharm when I have a class like this:

class Dog:

def __init__(self, name, breed):
self.__name = name
self.__breed = breed

Using Generate (alt + insert) I get a pop up menu with overrride, implement, and copyright items.  I cannot seem to find a way to generate the getter/setter methods.  I have tried selecting 'implement methods' and it actually does nothing at all.

Is this functionality simply unavailable?

Thank you for your help,


1 comment
Comment actions Permalink

Hi Marc,

You have probably already seen my answer in your ticket , but I'll just duplicate a short version here:

PyCharm doesn't have getter/setter generator, but instead it has prop and props live templates which serve vaguely the same purpose.


Please sign in to leave a comment.