Carl: upon reading your reply here, it occured to me that maybe my proposed inspect.get_annotations
should sprout a fourth format
. So far I’ve proposed three, “values”, “hybrid”, and “strings”. The fourth would be “ForwardRef
s”. I expect the “strings” implementation will internally produce ForwardRef
s anyway; it’ll calculate the annotation using a ForwardRef
, then extract the string and use that as the annotation value. So this fourth format will add only a negligible amount of code. This is much better than the user trying to turn the string back into a ForwardRef
themselves, as they may not have the proper globals / locals / closure handy.