diff options
Diffstat (limited to 'python.wiki')
-rw-r--r-- | python.wiki | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/python.wiki b/python.wiki new file mode 100644 index 0000000..1abbf49 --- /dev/null +++ b/python.wiki @@ -0,0 +1,20 @@ += Properties = +property + +{{{python +field = property(get_f, set_f) +}}} + +{{{python +class C: + def __init__(self): + self._x = 10 + + @property + def x(self): + return self._x + + @x.setter + def x(self, value): + self._x = value +}}} |