-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export a typing.ForwardRef
subclass
#17
Comments
In case we want to support this in a decent way, we can delegate the actual |
@alexmojaki Would you be interested in a quick PR to better show my idea? I'd find a use case for this in https://github.com/Lucretiel/autocommand and honestly think it will be a very convenient API this library can provide for other libraries. |
This makes sense, and I think it could easily be combined with something that patches |
Great! More than happy to dig out my old idea and make use of it again. |
Yeah, sorry for the mess. |
A convenient use case for providing a backport-supporting
typing.ForwardRef
subclass is when "stashing" info about type annotations in a way that allows to evaluate them later (within_eval_direct
and nottyping.ForwardRef._evaluate
, if applicable) with a proper runtime evaluation strategy "smuggled in" implicitly.Then, in libraries constructing
ForwardRef
from annotation strings manually, a snippet like this could be used to get the proper implementation ofForwardRef
:The text was updated successfully, but these errors were encountered: