Message 370031 - Python tracker (original) (raw)
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?