|
|
|
|
|
by orf
3191 days ago
|
|
Sure that was the idea, but I don't think I have ever seen any code use it like this. A single underscore is something that's not part of the classes public API, any child classes may need to change attributes, and by using a double underscore you are saying "I know better than you, you won't ever need to change this", which is never true. Python isn't like Java where you often have complex and often convoluted class heirachies, where truly private attributes might be more useful. |
|