[New-bugs-announce] [issue36924] Simplify implementation of classmethod_descriptor.__call__

Jeroen Demeyer report at bugs.python.org
Wed May 15 07:58:26 EDT 2019


New submission from Jeroen Demeyer <J.Demeyer at UGent.be>:

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.

----------
components: Interpreter Core
messages: 342566
nosy: Mark.Shannon, jdemeyer, petr.viktorin
priority: normal
severity: normal
status: open
title: Simplify implementation of classmethod_descriptor.__call__
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36924>
_______________________________________


More information about the New-bugs-announce mailing list