classification
Title: Simplify implementation of classmethod_descriptor.__call__
Type: Stage: patch review
Components: Interpreter Core Versions: Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Mark.Shannon, jdemeyer, petr.viktorin
Priority: normal Keywords: patch

Created on 2019-05-15 11:58 by jdemeyer, last changed 2019-05-15 12:17 by jdemeyer.

Pull Requests
URL Status Linked Edit
PR 13340 open jdemeyer, 2019-05-15 12:17
Messages (1)
msg342566 - (view) Author: Jeroen Demeyer (jdemeyer) * Date: 2019-05-15 11:58
The class classmethod_descriptor implements classmethods for builtin functions. Unlike the plain classmethod class (which is used for Python classmethods), instances of classmethod_descriptor are callable. However, calling them is unlikely to happen in practice: the only way to obtain such an object is to extract from the class __dict__.

Therefore, the implementation of __call__ does not need to be optimized: we can just call __get__ and then call the result. Doing that allows a simpler implementation of PEP 590.
History
Date User Action Args
2019-05-15 12:17:16jdemeyersetkeywords: + patch
stage: patch review
pull_requests: + pull_request13252
2019-05-15 11:58:26jdemeyercreate