From c8294934cdbe21e33e4f2d5cbfe060548495a645 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 22 Nov 2022 01:13:49 +0100 Subject: tis 22 nov 2022 01:13:49 CET --- python.wiki | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 python.wiki (limited to 'python.wiki') 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 +}}} -- cgit v1.2.3