]> granicus.if.org Git - python/commitdiff
bpo-30709: Improve code example in Descriptor HowTo doc (GH-2339)
author_ = NaN <anqurvanillapy@gmail.com>
Fri, 23 Jun 2017 03:54:35 +0000 (11:54 +0800)
committerMariatta <Mariatta@users.noreply.github.com>
Fri, 23 Jun 2017 03:54:35 +0000 (20:54 -0700)
Doc/howto/descriptor.rst

index 2dd6c34e2ced02dc548d0f58da0564f82cd33788..b34937585ea4445ad7b7eaf057e42ba3bbd8b9fe 100644 (file)
@@ -252,10 +252,10 @@ to wrap access to the value attribute in a property data descriptor::
 
     class Cell(object):
         . . .
-        def getvalue(self, obj):
-            "Recalculate cell before returning value"
+        def getvalue(self):
+            "Recalculate the cell before returning value"
             self.recalc()
-            return obj._value
+            return self._value
         value = property(getvalue)