Skip to content

Link type in docs signatures to Python's type - #2971

Merged
pvcraven merged 1 commit into
developmentfrom
docs-type-link
Oct 9, 2026
Merged

pvcraven merged 1 commit into
developmentfrom
docs-type-link

Conversation

@pvcraven

@pvcraven pvcraven commented Oct 9, 2026

Copy link
Copy Markdown
Member

Follow-up to #2970.

type[...] in API signatures linked to arcade.types.TiledObject.type, for example in UIManager.get_widgets_at(cls: type[W] | type[UIWidget]). That was 8 links on 5 pages.

Why: when an annotation names a class Sphinx can't find in Arcade's docs, PythonDomain.resolve_xref falls back to searching attributes with fuzzy matching, and finds TiledObject.type. Nitpicky mode can't catch this, because the link resolves.

Fix: a small PythonDomain subclass in doc/conf.py returns None for type in signatures, so intersphinx links Python's type instead. Everything else resolves as before.

I scanned the built docs for every link whose text is a Python built-in name but whose target is an Arcade page. type was the only one.

Checked:

🤖 Generated with Claude Code

When an annotation names a class Sphinx can't find, it falls back to
attributes whose names end with it, so type[W] linked to
arcade.types.TiledObject.type. A Python domain subclass skips arcade's
objects for type in signatures, so intersphinx links Python's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pvcraven
pvcraven merged commit 8e34d91 into development Oct 9, 2026
7 checks passed
@pvcraven
pvcraven deleted the docs-type-link branch October 9, 2026 19:04
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.

1 participant