private-members

Python private method for public usage

Python private method for public usage Question: I have a class A that need to implement a method meth(). Now, I don’t want this method to be called by the end-user of my package. Thus, I have to make this method private (i.e. _meth(). I know that it’s not really, private, but conventions matter.) The …

Total answers: 2

Pylint W0212 protected-access

Pylint W0212 protected-access Question: In Python, prefixing with one underscore indicates that a member should not be accessed outside of its class. This seems to be on a per-class basis like Java and C++. However, pylint seems to enforce this convention on a per-object basis. Is there a way to allow per-class access without resorting …

Total answers: 2