[issue44090] Add class binding to unbound super objects for allowing autosuper with class methods

Géry report at bugs.python.org
Tue Mar 29 12:10:33 EDT 2022


Géry <gery.ogam at gmail.com> added the comment:

Thanks for the review.

@rhettinger

> And adding classmethod() support in super_descr_get() would create tight coupling where there should be separate concerns (no other descriptor call is classmethod specific).

The descriptors `super`, `property`, and functions are already `classmethod` specific since their `__get__(instance, owner=None)` methods return `self` if `instance` is `None`, aren’t they?

> The OP's proposed use case is mildly plausible though I've never seen it the arise in practice.

I agree that the parameterized factory method use case might be too rare to be compelling.

@gvanrossum

> That was perhaps a good idea 20 years ago, but nowadays you can use argument-less super()

Yes this proposal is likely too late. I found your autosuper solution quite elegant (no compiler magic) so I wanted to make it work with `classmethod` too after I realized it doesn’t, thanks to Michele’s article.

----------

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


More information about the Python-bugs-list mailing list