Sorry, something went wrong.
|
@Fidget-Spinner Could you please review this PR? |
Sorry, something went wrong.
There was a problem hiding this comment.
Please wait until Serhiy merges some of his union refactoring changes. He's already prepared them, just not yet made PRs for review and merge. This will also take some time for me to review as I need to revise on tp_getattro and friends. Sorry (I'm busy with other things at the moment).
Also the current issue is getting too big. Can you please create a separate issue for this on bpo then tie this PR to that? We are getting pretty far from my original issue on the bpo ;).
Sorry, something went wrong.
|
I created separate issue at issue tracker. |
Sorry, something went wrong.
|
@Fidget-Spinner I have merged Serhiy changes. Could you please review this PR? |
Sorry, something went wrong.
|
Can you please split the PR into two? It seems it's fixing pickling and typing.Annotated compatibility at the same time. Please create another issue for the annotated problem. |
Sorry, something went wrong.
|
Sorry about that, I thought that it will be a great idea to fix several issues in scope of one PR. I will divide it at 2 separate PR. |
Sorry, something went wrong.
|
@Fidget-Spinner This PR contains only typing.Annotated compatibility fix. |
Sorry, something went wrong.
|
Sorry about that, I thought that it will be a great idea to fix several issues in scope of one PR. I will divide it at 2 separate PR. No worries. Thanks for separating them. It's much clearer to me now. |
Sorry, something went wrong.
There was a problem hiding this comment.
Looks good, I'll nosy a few others in too in case I missed something.
Sorry, something went wrong.
|
@Fidget-Spinner This PR is ready to be review. Could you please do it?) |
Sorry, something went wrong.
|
I'm thinking about whether we should just fix typing._GenericAlias to look for type(o).__module__ if o.__module__ doesn't exist. It seems easier than passing lookups to the parent type in types.Union. types.GenericAlias is a little special because it's supposed to be nearly completely transparent and pass everything to __origin__. But no other builtin type behaves like this. Eg. {}.__module__ doesn't have __name__ or __qualname__ etc. Then again, types.Union isn't like the other builtin types is it? I'll ping Łukasz when it's monday for him. Or maybe Jelle can give his opinion too. Off topic: I'm trying not to review stuff on sundays so that I have more time to work on other things :). So in the future I won't be able to respond very quickly to review requests on sunday. |
Sorry, something went wrong.
|
@ambv or @JelleZijlstra what do y'all think? Should we fix the typing module's Annotated or fix types.Union? |
Sorry, something went wrong.
|
I haven't looked deeply but in general I'd prefer to make Annotated do as little runtime checking as possible, so we don't have to jump through hoops to make things like Union work with it. |
Sorry, something went wrong.
There was a problem hiding this comment.
I haven't looked deeply but in general I'd prefer to make Annotated do as little runtime checking as possible, so we don't have to jump through hoops to make things like Union work with it.
Thanks for your input Jelle :).
LGTM mostly. I'm convinced we should add __module__ to Union now. Thanks for your efforts Yurii.
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks
Sorry, something went wrong.
|
@ambv: Please replace # with GH- in the commit message next time. Thanks! |
Sorry, something went wrong.
|
GH-27461 is a backport of this pull request to the 3.10 branch. |
Sorry, something went wrong.
https://bugs.python.org/issue44662