When you do this, it seems that
gd.__pay = 800000 should have an error, but I wonder why it is output without an error.
It would be helpful if you refer to the document below.
A "private" instance variable that can only be accessed inside the object does not exist in Python. However, there is a convention that most Python codes follow: names that begin with an underscore (for example,
_spam) should be treated as non-public parts of the API.
© 2022 pinfo. All rights reserved.