Skip to content

Commit

Permalink
bpo-30530: Update Descriptor How To Documentation (GH-1845) (GH-1953)
Browse files Browse the repository at this point in the history
Update the code example in Functions and Methods section
Remove objtype argument in MethodType
(cherry picked from commit 1bced56)
  • Loading branch information
Mariatta committed Jun 5, 2017
1 parent 47779d7 commit 86eb93f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Doc/howto/descriptor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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::

Expand Down

0 comments on commit 86eb93f

Please sign in to comment.