Author vstinner
Recipients BTaskaya, barry, brett.cannon, eric.smith, gvanrossum, levkivskyi, lukasz.langa, vstinner
Date 2020-05-26.20:45:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1590525955.37.0.315529072755.issue38605@roundup.psfhosted.org>
In-reply-to
Content
> The second problem is `inspect.signature`. If we don't resolve annotations there and continue it is definitely going to break some code.

Would you mind to elaborate why would it break some code? Consumers of annotations should already be prepared to get directly types or strings, no?

> If we resolve, that would mean that annotations must able to point something real (and this might not be the real case if the user uses a string annotation etc.) and will break code. (both tried and both breaks different modules on the stdlib tests)

I expect that resolving has an impact on performance, whereas the caller may not use annotations at all but only cares of the number of parameters or their name.

It would be resonable to not resolve annotations in signature() by default. If someone cares, maybe a new parameter can be added to resolve annotations?
History
Date User Action Args
2020-05-26 20:45:55vstinnersetrecipients: + vstinner, gvanrossum, barry, brett.cannon, eric.smith, lukasz.langa, levkivskyi, BTaskaya
2020-05-26 20:45:55vstinnersetmessageid: <1590525955.37.0.315529072755.issue38605@roundup.psfhosted.org>
2020-05-26 20:45:55vstinnerlinkissue38605 messages
2020-05-26 20:45:55vstinnercreate