diff options
Diffstat (limited to 'no-getter-nor-setter-in-python.py')
-rw-r--r-- | no-getter-nor-setter-in-python.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/no-getter-nor-setter-in-python.py b/no-getter-nor-setter-in-python.py new file mode 100644 index 0000000..b951182 --- /dev/null +++ b/no-getter-nor-setter-in-python.py @@ -0,0 +1,8 @@ +class Foo: + def __init__(self, x): + self.x = x + +obj = Foo(42) +print(obj.x) +obj.x = 22 +print(obj.x) |