FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Remove `builtins.ellipsis` pseudo-type by srittau · Pull Request #15712 · python/typeshed · GitHub

Repository navigation

Remove builtins.ellipsis pseudo-type - #15712

Merged
srittau merged 6 commits into
mainfrom
rm-ellipsis
Oct 8, 2026
Merged

srittau merged 6 commits into
mainfrom
rm-ellipsis

Conversation

srittau commented May 7, 2026 •
edited
Loading

Copy link
Copy Markdown
Collaborator

This type never existed at runtime, and was replaced by types.EllipsisType.

Part of #7580.

This type never existed at runtime, and was replaced by `types.EllipsisType`.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

JelleZijlstra pushed a commit to python/mypy that referenced this pull request Aug 29, 2026
Part of #8240

Unblocks python/typeshed#15712

The actual change is one line in checkexpr and the other changes are for
tests, mostly mechanical.
I used the try except trick used for `types.ModuleType` in the name
lookup so that tests that don't import the `types` module don't crash
with `KeyError` when they use `...` (which is used in almost all tests
as empty function body).

Most test changes are caused by modules now correctly resolving to
module type instead of `object` because some fixtures started importing
`types`.

The changes are mine, I only used a coding agent to fix the
`fine-grained-modules.test` and `testexportjson.py` tests and the
missing visitor method.

Copy link
Copy Markdown
Contributor

@srittau we have python/mypy#21911 now. Hopefully it will be included in the next mypy release and this PR will be unblocked.

Copy link
Copy Markdown
Member

Woah, thanks so much @hamdanal!

This comment has been minimized.

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

AlexWaygood 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

LGTM!

srittau marked this pull request as ready for review October 8, 2026 13:49
srittau merged commit 0d9b192 into main Oct 8, 2026
88 checks passed
srittau deleted the rm-ellipsis branch October 8, 2026 13:51

carljm commented Oct 15, 2026 •
edited
Loading

Copy link
Copy Markdown
Member

In pulling this update into ty, our test suite made us aware of the fact that Pydantic 2.13 still uses builtins.ellipsis, so this change results in significantly degraded type-checking for users of Pydantic 2.13. This is fixed in Pydantic 2.14. Maybe this is acceptable, just flagging it since it doesn't seem to have been discussed here.

bschnurr added a commit to microsoft/pyright that referenced this pull request Oct 23, 2026
* Update typeshed to 7030b265d887eeacee07e47aa2cca412b07950c4

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4b5fccb8-2031-4188-bdc6-cf3405acbc3f

* Adapt ellipsis samples to upstream pseudo-type removal

Classification A/C: typeshed commit 0d9b1926fc75ea33c643171b83cea73e3dd9990c (python/typeshed#15712) removes builtins.ellipsis, which never existed at runtime. Use types.EllipsisType to retain exact narrowing expectations, update the builtins symbol list, and remove the obsolete pseudo-type runtime-check case. No reveal expectations are weakened.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4b5fccb8-2031-4188-bdc6-cf3405acbc3f

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4b5fccb8-2031-4188-bdc6-cf3405acbc3f
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.

4 participants


Back | FazBrowse Home | New Git URL