bpo-30530: Update Descriptor How To Documentation (GH-1845) (GH-1953) · python/cpython@86eb93f (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Commit 86eb93f
Update the code example in Functions and Methods section Remove objtype argument in MethodType (cherry picked from commit 1bced56)
File tree
1 file changed
lines changed
1 file changed
lines changed
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -282,7 +282,7 @@ this:: | ||
282 | 282 | . . . |
283 | 283 | def __get__(self, obj, objtype=None): |
284 | 284 | "Simulate func_descr_get() in Objects/funcobject.c" |
285 | - return types.MethodType(self, obj, objtype) | |
285 | + return types.MethodType(self, obj) | |
286 | 286 | |
287 | 287 | Running the interpreter shows how the function descriptor works in practice:: |
288 | 288 |