[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:
Mariatta 2017-06-22 21:24:43 -07:00 committed by GitHub
parent 8baf78b98f
commit d79ac2c246

View file

@ -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)