bpo-44662: Add ability to annotate types.Union#27214
Conversation
|
@Fidget-Spinner Could you please review this PR? |
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 ;).
|
I created separate issue at issue tracker. |
|
@Fidget-Spinner I have merged Serhiy changes. Could you please review this PR? |
|
Can you please split the PR into two? It seems it's fixing pickling and |
|
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. |
|
@Fidget-Spinner This PR contains only |
No worries. Thanks for separating them. It's much clearer to me now. |
Fidget-Spinner
left a comment
There was a problem hiding this comment.
Looks good, I'll nosy a few others in too in case I missed something.
Misc/NEWS.d/next/Core and Builtins/2021-07-17-13-41-58.bpo-44662.q22kWR.rst
Outdated
Show resolved
Hide resolved
…62.q22kWR.rst Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
|
@Fidget-Spinner This PR is ready to be review. Could you please do it?) |
|
I'm thinking about whether we should just fix
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. |
|
@ambv or @JelleZijlstra what do y'all think? Should we fix the typing module's Annotated or fix types.Union? |
|
I haven't looked deeply but in general I'd prefer to make |
Fidget-Spinner
left a comment
There was a problem hiding this comment.
I haven't looked deeply but in general I'd prefer to make
Annotateddo as little runtime checking as possible, so we don't have to jump through hoops to make things likeUnionwork with it.
Thanks for your input Jelle :).
LGTM mostly. I'm convinced we should add __module__ to Union now. Thanks for your efforts Yurii.
|
@ambv: Please replace |
|
GH-27461 is a backport of this pull request to the 3.10 branch. |
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> (cherry picked from commit 8182c83) Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
https://bugs.python.org/issue44662