[Python] Do we need to have a separate getter while using @property? [duplicate]

Discussão em 'Python' iniciado por Stack, Março 27, 2025.

  1. Stack

    Stack Membro Participativo

    I have these two methods inside a class:

    @property
    def config_dict(self):
    return self._config_dict

    @config_dict.getter
    def config_dict(self):
    return self._config_dict


    Do we really need the getter? Isn't it superfluous?

    Continue reading...

Compartilhe esta Página