[Python] Make a python property with the same name as the class member name

Discussão em 'Python' iniciado por Stack, Maio 21, 2025.

  1. Stack

    Stack Membro Participativo

    Is it possible in python to create a property with the same name as the member variable name of the class. e.g.

    Class X:
    ...
    self.i = 10 # marker
    ...
    property(fget = get_i, fset = set_i)


    Please tell me how I can do so. Because if I do so, for the statement at marker I get stack overflow for the assingm

    Continue reading...

Compartilhe esta Página