Ken Jin <kenjin4...@gmail.com> added the comment:

> Now a subclass of an Annotated alias is a generic type. Should it be?

I'm unsure if Annotated should be subclassable in the first place, but if I 
understand PEP 593 correctly,
class X(Annotated[int, (1, 10)]), should be equivalent to class X(int) right? 
If that's the case, it's subclassable and Generic shouldn't be in the MRO.

FWIW, the other special forms don't allow subclassing, so we don't need to 
think about this problem for them. Annotated is a special cookie.

I propose we just drop the _name hack temporarily in Annotated. A real fix 
requires fixing up __mro_entries__, but I am uncomfortable with us backporting 
to 3.10 anything that touches __mro_entries__ due to the numerous edge cases it 
has and how close we are to 3.10 final.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue44524>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to