Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #109718 > unrolled thread
| Started by | Peter Otten <__peter__@web.de> |
|---|---|
| First post | 2016-06-09 11:49 +0200 |
| Last post | 2016-06-09 11:49 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: what is wrong with this property setter Peter Otten <__peter__@web.de> - 2016-06-09 11:49 +0200
| From | Peter Otten <__peter__@web.de> |
|---|---|
| Date | 2016-06-09 11:49 +0200 |
| Subject | Re: what is wrong with this property setter |
| Message-ID | <mailman.101.1465465810.2306.python-list@python.org> |
Nagy László Zsolt wrote: > >>> Yes, and more. That property will also have a get method! Is it >>> intentional? >> It's a logical effect of how the setter() method works. The above is >> syntactic sugar for >> >> def set_parent(...): >> ... >> set_parent = parent.setter(set_parent) >> >> and parent.setter() creates a new property basically like this >> >> def setter(self, fset): >> return property(self.fget, fset, ...) > This I could not find, because property is a built-in. But I believe > you. :-) If you can read C: https://hg.python.org/cpython/file/tip/Objects/descrobject.c#l1183 https://hg.python.org/cpython/file/tip/Objects/descrobject.c#l1265
Back to top | Article view | comp.lang.python
csiph-web