Python Philosophy - Consenting Adults
https://discuss.python.org/t/private-protected-modifier-and-notation/22356/10
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.
作为一个成熟的 coder,Python 的 dark secrect/黑魔法都向你开放,但是你需要对滥用负责。
Comments