← 返回首页
bpo-41428: Implementation for PEP 604 by maggiemoss · Pull Request #21515 · python/cpython · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

bpo-41428: Implementation for PEP 604#21515

Merged
pablogsal merged 62 commits into
python:masterfrom
maggiemoss:PEP605-implementation
Sep 9, 2020
Merged

bpo-41428: Implementation for PEP 604#21515
pablogsal merged 62 commits into
python:masterfrom
maggiemoss:PEP605-implementation

Conversation

maggiemoss commented Jul 17, 2020
edited by gvanrossum
Loading

Copy link
Copy Markdown
Contributor

PEP 604 - Proposed Implementation

https://www.python.org/dev/peps/pep-0604/

Building off of the comments left on this PR here: https://github.com/pprados/cpython/tree/PEP604

https://bugs.python.org/issue41428

maggiemoss requested review from a team, gvanrossum and ilevkivskyi as code owners July 17, 2020 00:07

This comment has been minimized.

Comment thread Objects/typeobject.c Outdated Show resolved Hide resolved
maggiemoss changed the title Pep605 implementation Pep604 - Draft Implementation Jul 17, 2020

Copy link
Copy Markdown
Member

Thank you so much! Give me a few days to review this. Ping me if you haven't heard from me by Wednesday!

gvanrossum changed the title Pep604 - Draft Implementation PEP 604 - Draft Implementation Jul 18, 2020

gvanrossum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

Great start! Here's a boatload of review comments, from whitespace nits to feature requests.

Comment thread Lib/test/test_isinstance.py Outdated Show resolved Hide resolved
Comment thread Lib/test/test_types.py Outdated Show resolved Hide resolved
Comment thread Lib/typing.py Outdated Show resolved Hide resolved
Comment thread Lib/typing.py Outdated Show resolved Hide resolved
Comment thread Objects/abstract.c Outdated Show resolved Hide resolved
13 hidden conversations Load more…
Comment thread Objects/unionobject.c Outdated Show resolved Hide resolved
Comment thread Objects/unionobject.c Outdated Show resolved Hide resolved
Comment thread Objects/unionobject.c Show resolved Hide resolved
Comment thread Objects/unionobject.c Show resolved Hide resolved
Comment thread Objects/unionobject.c Outdated Show resolved Hide resolved

gvanrossum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

(Presumably you were going to add more commits before asking for another review?)

Comment thread Lib/test/test_isinstance.py Outdated Show resolved Hide resolved
Comment thread Objects/abstract.c Outdated Show resolved Hide resolved
Comment thread Objects/unionobject.c Show resolved Hide resolved

Copy link
Copy Markdown
Contributor Author

@gvanrossum thanks so much for the comments! I'll implement your suggestions and clean this up :)

131 hidden items Load more…
maggiemoss requested a review from pablogsal August 18, 2020 22:32

Copy link
Copy Markdown
Contributor Author

@gvanrossum

I had thought of another case we might need to handle here, and was hoping to get your input. Should this:

typing.Union[int, str] is (int | str)

evaluate to true?

Copy link
Copy Markdown
Contributor Author

@pablogsal let me know if there are any other changes you'd like to see here.

Copy link
Copy Markdown
Member

@pablogsal let me know if there are any other changes you'd like to see here.

I just need to find some time to do another iteration 😉 Will try to do another pass by tomorrow, but we are very close! Thanks for the patience and tye good work :)

Comment thread Objects/unionobject.c Outdated Show resolved Hide resolved
Comment thread Include/unionobject.h Outdated Show resolved Hide resolved

Copy link
Copy Markdown
Member

@maggiemoss I have pushed a new commit (8c06c1d) to do some simplifications and to fix some minor reference count issues and crashes. Please, check out that everything seems ok in that commit :)

pablogsal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

This looks good to me!

Thanks for all the work and patience @maggiemoss! Great job :)

@gvanrossum I won't land it myself in case you or Maggie want to take a last check.

Comment thread Objects/unionobject.c Outdated Show resolved Hide resolved

gvanrossum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

I think it's good! Thanks so much Maggie for all your work.

Copy link
Copy Markdown
Contributor Author

Thanks so much for all of your reviews and comments, I've really appreciated it. 🎉

Copy link
Copy Markdown
Member

@maggiemoss
I noticed that some tests failed on Windows. Could it be that you need to rebase to the latest master?

"test.test_asyncio.test_sendfile.ProactorEventLoopTests.test_sendfile_close_peer_in_the_middle_of_receiving"

Copy link
Copy Markdown
Member

@maggiemoss
I noticed that some tests failed on Windows. Could it be that you need to rebase to the latest master?

"test.test_asyncio.test_sendfile.ProactorEventLoopTests.test_sendfile_close_peer_in_the_middle_of_receiving"

That's an unrelated race condition in asyncio in Windows, we can ignore it and just land

pablogsal merged commit 1b4552c into python:master Sep 9, 2020

gvanrossum commented Sep 9, 2020 via email

Copy link
Copy Markdown
Member

xzy3 pushed a commit to xzy3/cpython that referenced this pull request Oct 18, 2020
See https://www.python.org/dev/peps/pep-0604/ for more information. Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
AlexWaygood added a commit to AlexWaygood/typeshed that referenced this pull request Dec 4, 2021
- `__or__` was added to `TypeVar` in Python 3.10: https://bugs.python.org/issue41428 (this PR: python/cpython#21515) - `__or__` was added to `ForwardRef` in Python 3.11: https://bugs.python.org/issue45489
JelleZijlstra pushed a commit to python/typeshed that referenced this pull request Dec 5, 2021
- `__or__` was added to `TypeVar` in Python 3.10: https://bugs.python.org/issue41428 (this PR: python/cpython#21515) - `__or__` was added to `ForwardRef` in Python 3.11: https://bugs.python.org/issue45489
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Footer

© 2026 GitHub, Inc.