summaryrefslogtreecommitdiffhomepage
path: root/python.html.markdown
diff options
context:
space:
mode:
authortriumphantomato <91909240+triumphantomato@users.noreply.github.com>2023-09-07 22:30:31 -0700
committerGitHub <noreply@github.com>2023-09-08 13:30:31 +0800
commite9f263a75f0ec9c2984307d0fd4503f8476c02fa (patch)
tree9d742657fa801c234ae07ee2ece77c367fb502a0 /python.html.markdown
parent7b2491ecd5b3370b7cc712fced32b948440ecb40 (diff)
[python/en] add hint about leading underscore indicating internal use (#4748)
Diffstat (limited to 'python.html.markdown')
-rw-r--r--python.html.markdown4
1 files changed, 3 insertions, 1 deletions
diff --git a/python.html.markdown b/python.html.markdown
index 91a53360..efeb0e86 100644
--- a/python.html.markdown
+++ b/python.html.markdown
@@ -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):