diff options
Diffstat (limited to '')
-rw-r--r-- | Python.wiki | 32 | ||||
-rw-r--r-- | python.wiki | 20 |
2 files changed, 28 insertions, 24 deletions
diff --git a/Python.wiki b/Python.wiki index e221599..5df7d2e 100644 --- a/Python.wiki +++ b/Python.wiki @@ -1,7 +1,31 @@ +%title Python -== Imports are lazy == +[[PEP3131]] -=== main.py === += 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 +}}} + += Imports are lazy = + +== main.py == {{{python import sys @@ -17,13 +41,13 @@ match sys.argv: }}} -=== a.py === +== a.py == {{{python print('Importing a') x = 10 }}} -=== b.py === +== b.py == {{{python print('Importing b') x = 20 diff --git a/python.wiki b/python.wiki deleted file mode 100644 index 1abbf49..0000000 --- a/python.wiki +++ /dev/null @@ -1,20 +0,0 @@ -= 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 -}}} |