Pythonの勉強を続けています。 今回は👉 setter を学びました。 前回の @property とセットで使うことで、 👉 値の変更をコントロールできる仕組み です。 まずは普通に変更する場合 class Person: def __init__(self, name): self.name = namep1 = Person("Taro")p1.name = ""print(p1.name) 👉 この場合、空の名前でもそのまま入ってしまいます。 setterを使う class Person: def __init__(self, name): self._name = name @p…