]> granicus.if.org Git - python/commitdiff
bpo-30530: Update Descriptor How To Documentation (GH-1845)
authorMariano Anaya <rmariano@users.noreply.github.com>
Mon, 5 Jun 2017 02:46:50 +0000 (04:46 +0200)
committerMariatta <Mariatta@users.noreply.github.com>
Mon, 5 Jun 2017 02:46:50 +0000 (19:46 -0700)
Update the code example in Functions and Methods section
Remove objtype argument in MethodType

Doc/howto/descriptor.rst

index c2bf473e1ff9eaff9f352967ce63753474b167ab..2dd6c34e2ced02dc548d0f58da0564f82cd33788 100644 (file)
@@ -282,7 +282,7 @@ this::
         . . .
         def __get__(self, obj, objtype=None):
             "Simulate func_descr_get() in Objects/funcobject.c"
-            return types.MethodType(self, obj, objtype)
+            return types.MethodType(self, obj)
 
 Running the interpreter shows how the function descriptor works in practice::