Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
gh-90527: Evaluate typing.ForwardRef inside typing.NewType#91637
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
I think this will cause more trouble. NewTypes should generally be compared by identity, so creating a new one is problematic. I don't have a better idea though. |
@JelleZijlstra I think we can mutate ifisinstance(t,NewType):arg=ForwardRef(t.__supertype__)ifisinstance(t.__supertype__,str)elset.__supertype__t.__supertype__=_eval_type(arg,globalns,localns,recursive_guard)returnt What do you think about such option? |
JelleZijlstra commentedApr 17, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
That's also problematic:
|
Possible solution can be add |
Uh oh!
There was an error while loading.Please reload this page.