1

I see in a python class following pattern

class xxx(object):

    def __some_method():
        pass

    _some_method = __some_method

why would somebody use this pattern of assigning the Double Leading Underscore method to a Single Leading Underscore variable?

progressdll
  • 374
  • 3
  • 12
  • 1
    Does this answer your question? [What is the meaning of a single and a double underscore before an object name?](https://stackoverflow.com/questions/1301346/what-is-the-meaning-of-a-single-and-a-double-underscore-before-an-object-name) – Maroun Dec 10 '19 at 15:14
  • Would it mean i can override the function by changing the private variable – progressdll Dec 10 '19 at 15:24
  • 2
    Ultimately you would have to ask the author of this code what *exactly* their intention was behind this. – deceze Dec 10 '19 at 15:48
  • This doesn't make much sense at all – juanpa.arrivillaga Dec 10 '19 at 15:52

0 Answers0