From e9f263a75f0ec9c2984307d0fd4503f8476c02fa Mon Sep 17 00:00:00 2001 From: triumphantomato <91909240+triumphantomato@users.noreply.github.com> Date: Thu, 7 Sep 2023 22:30:31 -0700 Subject: [python/en] add hint about leading underscore indicating internal use (#4748) --- python.html.markdown | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'python.html.markdown') 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): -- cgit v1.2.3