[issue37203] Correct classmethod emulation in Descriptor HowTo Guide

2020-10-24 Thread Géry
Change by Géry : -- versions: +Python 3.9 -Python 3.7 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37203] Correct classmethod emulation in Descriptor HowTo Guide

2020-10-24 Thread Géry
Change by Géry : -- resolution: not a bug -> fixed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37203] Correct classmethod emulation in Descriptor HowTo Guide

2020-10-24 Thread Géry
Change by Géry : -- pull_requests: +21866 pull_request: https://github.com/python/cpython/pull/22934 ___ Python tracker ___ ___

[issue37203] Correct classmethod emulation in Descriptor HowTo Guide

2019-06-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: How about taking another look at this after I've finished my more extensive rewrite based on my course materials. -- ___ Python tracker

[issue37203] Correct classmethod emulation in Descriptor HowTo Guide

2019-06-09 Thread Géry
Géry added the comment: @Raymond Hettinger > The goal in the descriptor how-to is to give an understanding of how > descriptors work. Okay. So I don't know if that was clear in my last message but that also means replacing the current "Function" implementation: class Function(object):

[issue37203] Correct classmethod emulation in Descriptor HowTo Guide

2019-06-08 Thread Raymond Hettinger
Raymond Hettinger added the comment: I'm going to close this because 1) I'm working on a somewhat major set of updates this guide already and 2) I think this tracker issue misses the point of what those guide is trying to do (communicating that the class is prepended to the argument stream

[issue37203] Correct classmethod emulation in Descriptor HowTo Guide

2019-06-08 Thread Géry
Géry added the comment: @Raymond Hettinger > Though less accurate, the current version communicates better I agree that types.MethodType is more accurate but may be less understandable. But in this case I think that the Function class for emulating instance methods should not use

[issue37203] Correct classmethod emulation in Descriptor HowTo Guide

2019-06-08 Thread Raymond Hettinger
Raymond Hettinger added the comment: This wasn't intended to be an exact equivalent. Instead, it focuses on the key action of classmethod which is prepending the class to the call. Though less accurate, the current version communicates better. I suggest adding a short comment to the

[issue37203] Correct classmethod emulation in Descriptor HowTo Guide

2019-06-08 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: docs@python -> rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue37203] Correct classmethod emulation in Descriptor HowTo Guide

2019-06-08 Thread Géry
New submission from Géry : With the current Python equivalent `ClassMethod` implementation of `classmethod` given in Raymond Hettinger's _Descriptor HowTo Guide_, the following code snippet: ``` class A: @ClassMethod def f(cls, *, x): pass print(A.f) A.f(x=3) ``` prints: > .newfunc