Skip to content

Commit

Permalink
bpo-30530: Update Descriptor How To Documentation (GH-1845)
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
  • Loading branch information
rmariano authored and Mariatta committed Jun 5, 2017
1 parent d3bedf3 commit 1bced56
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 1bced56

Please sign in to comment.