Skip to content

apidoc: drop useless longest-first sort in is_initpy - #14537

Closed
adamtheturtle wants to merge 1 commit into
sphinx-doc:masterfrom
adamtheturtle:adamtheturtle/apidoc-is-initpy-drop-sort
Closed

adamtheturtle wants to merge 1 commit into
sphinx-doc:masterfrom
adamtheturtle:adamtheturtle/apidoc-is-initpy-drop-sort

Conversation

@adamtheturtle

@adamtheturtle adamtheturtle commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

No description provided.

Equality checks do not need suffix order, and longest-first made the common `__init__.py` case slower.

Co-authored-by: Cursor <[email protected]>

@jdillard jdillard 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.

The sort cannot affect equality-based results, and removing it avoids rebuilding and sorting the suffix list on every call while restoring .py as the first/common case.

Existing apidoc tests seem to cover relevant suffix behavior.

@jdillard

Copy link
Copy Markdown
Member

Closing in favor of #14538, which includes this change alongside the other two rewrites needed to make the pinned ty check pass. Keeping the related fixes together seems more useful than landing this one independently.

@jdillard jdillard closed this Jul 23, 2026
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants