🐛 fix(annotations): use class role for Ellipsis/NotImplementedType on 3.13+#707
Merged
Conversation
… 3.13+ The Python 3.13 docs changed the inventory entries for ``types.EllipsisType`` and ``types.NotImplementedType`` from ``py:data`` to ``py:class``, which broke the scheduled CI job that resolves the expected role from the live docs.python.org inventory. Emit the ``class`` role for these two types on Python 3.13+ and keep ``data`` on 3.12 and earlier.
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The scheduled CI job on
mainstarted failing because the Python documentation changed the intersphinx inventory entries fortypes.EllipsisTypeandtypes.NotImplementedTypefrompy:datatopy:class. 🐛 The role test resolves the expected role from the livedocs.python.orginventory, so once the upstream docs shifted, the run broke on Python 3.13 and 3.14 while 3.12 kept passing since its docs still exposepy:data.The upstream change is python/cpython#150682 (
gh-89554: Document NoneType, NotImplementedType and EllipsisType as classes), backported to 3.13 in python/cpython#150757, to 3.14 in python/cpython#150756, and to 3.15 in python/cpython#150755. It was merged on 2026-06-02 and not backported to 3.12, which is why only the 3.13+ inventories are affected.The fix makes the role selection version-aware: emit the
classrole for these two types on Python 3.13 and newer, and keepdataon 3.12 and earlier. This mirrors the existing version-conditional handling already in place fortyping.Union.Reviewers should note this only affects how these two
typesmembers are cross-referenced in generated docs; everything else in the annotation formatting path is unchanged.