This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author larry
Recipients eric.smith, gvanrossum, larry
Date 2021-04-21.22:59:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1619045980.53.0.850350648931.issue43901@roundup.psfhosted.org>
In-reply-to
Content
By the way, here's a tidbit I never got around to posting in c.l.p-d.

I noted in the conversation in January that attrs is an outlier here: it *doesn't* look in the class dict for __annotations__.  Instead, it has some complicated code where it asks the class for its annotations, then iterates over the __mro__ and asks every base class for *its* annotations.  If the class and a base class have the same class dict (using the "is" operator iirc) then attrs says "oh, that class doesn't have its own annotations, it's inheriting them" and reacts appropriately.

I emailed Hynek to ask him why he did it that way.  It turns out, he did that because at the time he didn't know you could peek in the class dict for __annotations__.  He literally had a todo item saying "change to looking in the class dict".
History
Date User Action Args
2021-04-21 22:59:40larrysetrecipients: + larry, gvanrossum, eric.smith
2021-04-21 22:59:40larrysetmessageid: <1619045980.53.0.850350648931.issue43901@roundup.psfhosted.org>
2021-04-21 22:59:40larrylinkissue43901 messages
2021-04-21 22:59:40larrycreate