mirror of
https://github.com/python/cpython.git
synced 2025-09-30 12:21:51 +00:00
bpo-30530: Update Descriptor How To Documentation (GH-1845) (GH-1953)
Update the code example in Functions and Methods section
Remove objtype argument in MethodType
(cherry picked from commit 1bced56567
)
This commit is contained in:
parent
47779d720a
commit
86eb93fae6
1 changed files with 1 additions and 1 deletions
|
@ -282,7 +282,7 @@ this::
|
||||||
. . .
|
. . .
|
||||||
def __get__(self, obj, objtype=None):
|
def __get__(self, obj, objtype=None):
|
||||||
"Simulate func_descr_get() in Objects/funcobject.c"
|
"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::
|
Running the interpreter shows how the function descriptor works in practice::
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue