[issue43817] Add inspect.get_annotations()

Larry Hastings report at bugs.python.org
Thu Apr 29 09:28:45 EDT 2021


Larry Hastings <larry at hastings.org> added the comment:

Ie debated about this with myself (and with a friend!) over the last few days, and I've concluded that evaluating strings by default is too opinionated for the standard library.  I've changed both inspect.signature() and inspect.get_annotations() so eval_str is False by default (and removed the ONLY_IF_STRINGIZED logic entirely).  Both functions will still raise an exception if eval_str=True, but this will only happen if the user explicitly requests evaluating the strings.

I've already updated the PR.

----------

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


More information about the Python-bugs-list mailing list