Would annotations() just access the dunder, like other builtins (and then result in the descriptor resolving __co_annotations__ as proposed), or would calling it be required to actually resolve __co_annotations__? I think it should probably be the former.
On Sat, 2021-01-16 at 12:29 +1300, Greg Ewing wrote: > On 16/01/21 7:56 am, Larry Hastings wrote: > > > > As mentioned previously in this > > thread, typing.get_type_hints() is opinionated in ways that users > > of > > annotations may not want. > > This brings us back to my idea of introducing a new > annotations() function to hide the details. It wouldn't > be the same as get_type_hints(), since it wouldn't make > any assumptions about what the annotations mean. >
_______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/457EYGAJAE4BQHUWH32MRZNSLFGNR6MM/ Code of Conduct: http://python.org/psf/codeofconduct/