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 JelleZijlstra
Recipients JelleZijlstra, barry, eric.smith, gvanrossum, kj, larry, lukasz.langa, methane, xtreak
Date 2021-04-26.21:43:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1619473407.43.0.867722510758.issue43817@roundup.psfhosted.org>
In-reply-to
Content
I agree with Guido that it's better to design inspect.signature to not throw an error for annotations that don't eval() cleanly.

I use inspect.signature for getting information about callables (third-party and first-party) in my type checker: https://github.com/quora/pyanalyze/blob/master/pyanalyze/arg_spec.py#L436. 
 In that context, I'd much rather get string annotations that I can process myself later than get an exception if the annotations aren't valid at runtime. In the former case I can still get useful information out of the signature even if I don't know how to process some annotations. For example, I'll still know what parameters exist even if I don't know what their types are. In the latter case, I don't get any useful signature data.
History
Date User Action Args
2021-04-26 21:43:27JelleZijlstrasetrecipients: + JelleZijlstra, gvanrossum, barry, larry, eric.smith, methane, lukasz.langa, xtreak, kj
2021-04-26 21:43:27JelleZijlstrasetmessageid: <1619473407.43.0.867722510758.issue43817@roundup.psfhosted.org>
2021-04-26 21:43:27JelleZijlstralinkissue43817 messages
2021-04-26 21:43:27JelleZijlstracreate