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 kj
Recipients The Compiler, eric.smith, gvanrossum, kj, levkivskyi
Date 2021-03-15.17:28:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>

IIUC inspect.signature auto-resolves string annotations to typing.ForwardRef internally from 3.10 onwards. It's mentioned in the what's new for PEP 563

If it fails, it will just give the string. So the only place where inspect.signature might start giving you different output is if you previously defined a function like so:

def foo(a: 'MyType'): ...

And you expected inspect.signature.paramters to be ``[<Parameter "a: 'MyType'">]`` (the string). However if MyType is in globals()/locals(), you'll instead get ``[<Parameter "a: MyType">]`` in 3.10.

FWIW someone already reported that in Issue43355.
Date User Action Args
2021-03-15 17:28:53kjsetrecipients: + kj, gvanrossum, eric.smith, The Compiler, levkivskyi
2021-03-15 17:28:53kjsetmessageid: <>
2021-03-15 17:28:53kjlinkissue43463 messages
2021-03-15 17:28:53kjcreate