I like to quote Peters' Zen of Python. "Explicit is better than implicit."
In Java and C++, 'this.
' can be deduced, except when you have variable names that make it impossible to deduce. So you sometimes need it and sometimes don't.
Python elects to make things like this explicit rather than based on a rule.
Additionally, since nothing is implied or assumed, parts of the implementation are exposed. self.__class__
, self.__dict__
and other "internal" structures are available in an obvious way.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…