Skip to content

Commit 46d7672

Browse files
authored
fix: 代码违背文字描述
文字描述:“另外,你可能还会问为什么 ``__init__()`` 方法中设置了 ``self.first_name`` 而不是 ``self._first_name`` 。” 参考: https://github.com/yidao620c/python3-cookbook/blob/master/cookbook/c08/p06_managed_attribute.py#L12
1 parent a9cd77b commit 46d7672

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

source/c08/p06_create_managed_attributes.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
1818
class Person:
1919
def __init__(self, first_name):
20-
self._first_name = first_name
20+
self.first_name = first_name
2121
2222
# Getter function
2323
@property

0 commit comments

Comments
 (0)