3 ms·
Because in traditional object-oriented design you would extend rather than patch. It's the open-closed principle. There are many benefits to enforcing privacy,
by twblalock 8y ago
Because in traditional object-oriented design you would extend rather than patch. It's the open-closed principle.
There are many benefits to enforcing privacy, and one of the biggest ones is that you can make changes to the internals of your library without breaking your users' code, because they never had access to the internals.
- xapata 8y agoYou can get that benefit with Python. Name mangling helps. It gets the benefits of `final` without the annoying enforcement. Don't stop me from patching your buggy code. If writing an extension is more efficient, that's how I'd solve the problem.