Private, protected modifier and __ notation

Python has a “consenting adults” policy – we use various idioms, such as leading underscores, to inform other programmers what methods, attributes, etc., shouldn’t be messed with, and then leave it up to them. If they do use or modify these private and/or internal objects, then any consequences of it not working correctly are their responsibility.

However, this also means that people can extend functionality, or more easily work around bugs, because they have access to those private/internal data and functions.

2 Likes