[issue46743] Enable usage of object.__orig_class__ in __init__

Guido van Rossum report at bugs.python.org
Mon Feb 14 11:34:58 EST 2022


Guido van Rossum <guido at python.org> added the comment:

> On the general class instanciation point would there be anything wrong with just adding a big red warning saying (on the non-existent) docs for these classes that they don't follow normal class initization or is this too insignificant of an issue to bother?

Which classes? Every class that inherits from Generic? That would be problematic -- we don't want the addition of typing information to change the behavior of a construct (or at least as little as possible).

> I think you could make this work with a Protocol as the bound TypeVar("T", bound=HasTheCorrectNewSignature)?

Sure.

But I am still inclined to reject the feature request as too obscure.

----------

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


More information about the Python-bugs-list mailing list