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 eric.smith
Recipients JelleZijlstra, barry, eric.smith, gvanrossum, kj, larry, methane, xtreak
Date 2021-04-21.10:00:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1618999242.23.0.6193239316.issue43817@roundup.psfhosted.org>
In-reply-to
Content
> If o.__annotations__ is None, should this function set the empty dict on the object?  That seems slightly too opinionated to me.  On the other hand, the user would probably expect that they could change the dict they got back.

Are you saying the user would expect to be able to change __annotations__ my modifying the dict they get back?

Is it ever the case that the user can modify __annotations__ through the dict that's returned? That is: does __annotations__ itself ever get returned?

I think you'd either want __annotations__ returned all the time, or never returned. Otherwise some cases could modify __annotations__, and some couldn't.

If __annotations__ is never returned, then I wouldn't set __annotations__ in this case.
History
Date User Action Args
2021-04-21 10:00:42eric.smithsetrecipients: + eric.smith, gvanrossum, barry, larry, methane, JelleZijlstra, xtreak, kj
2021-04-21 10:00:42eric.smithsetmessageid: <1618999242.23.0.6193239316.issue43817@roundup.psfhosted.org>
2021-04-21 10:00:42eric.smithlinkissue43817 messages
2021-04-21 10:00:42eric.smithcreate