mirror of
https://github.com/python/cpython.git
synced 2025-10-01 12:52:18 +00:00
[3.6] bpo-30709: Improve code example in Descriptor HowTo doc (GH-2339) (GH-2342)
(cherry picked from commit b066edfb1b
)
This commit is contained in:
parent
8baf78b98f
commit
d79ac2c246
1 changed files with 3 additions and 3 deletions
|
@ -252,10 +252,10 @@ to wrap access to the value attribute in a property data descriptor::
|
||||||
|
|
||||||
class Cell(object):
|
class Cell(object):
|
||||||
. . .
|
. . .
|
||||||
def getvalue(self, obj):
|
def getvalue(self):
|
||||||
"Recalculate cell before returning value"
|
"Recalculate the cell before returning value"
|
||||||
self.recalc()
|
self.recalc()
|
||||||
return obj._value
|
return self._value
|
||||||
value = property(getvalue)
|
value = property(getvalue)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue