Skip to content

Fix none type link#14301

Open
Kirubapanneers wants to merge 5 commits intosphinx-doc:masterfrom
Kirubapanneers:fix-none-type-link
Open

Fix none type link#14301
Kirubapanneers wants to merge 5 commits intosphinx-doc:masterfrom
Kirubapanneers:fix-none-type-link

Conversation

@Kirubapanneers
Copy link

@Kirubapanneers Kirubapanneers commented Feb 13, 2026

This PR restores the hyperlink for None in type annotations, which stopped working after Sphinx 4.4.0.

The previous commit (5da68c3) removed special handling for None. I added that logic back in PyField and PyTypedField classes. None should be handled as an object reference (:obj:) not as a class reference (:class:).

##Testing
I ran all Python domain tests (98 tests passed).
I created a small test document using None in type hints.
Verified that None is now clickable and properly linked again.

Note on failing CI checks

The following test failures appear to be pre existing issues unrelated to this PR:

  • test_autogen
  • test_autogen_remove_old
  • test_numfig_disabled_warn

These tests are failing on the main branch as well and are not caused by the changes in this PR.

##My changes only touch:

  • sphinx/domains/python/_object.py - restored None hyperlink handling
  • sphinx/util/typing.py and doc/index.rst - fixed formatting issues

References
fixes #10899

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.

py domain: None is no longer hyperlinked after 4.4.0

1 participant