[Python] In Python, what is the underscore in front of the instance variable?

Discussão em 'Python' iniciado por Stack, Julho 9, 2025.

  1. Stack

    Stack Membro Participativo

    What convention is it?

    class IndexedText(object):
    def __init__(self, stemmer, text):
    self._text = text
    self._stemmer = stemmer
    self._index = nltk.Index((self._stem(word), i) for (i, word) in enumerate(text))

    Continue reading...

Compartilhe esta Página