[python/en] add hint about leading underscore indicating internal use (#4748)

This commit is contained in:
triumphantomato 2023-09-07 22:30:31 -07:00 committed by GitHub
parent 7b2491ecd5
commit e9f263a75f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -733,7 +733,9 @@ class Human:
self.name = name
# Initialize property
self._age = 0
self._age = 0 # the leading underscore indicates the "age" property is
# intended to be used internally
# do not rely on this to be enforced: it's a hint to other devs
# An instance method. All methods take "self" as the first argument
def say(self, msg):