René's URL Explorer Experiment


Title: fix: Expand relative cross-references against the object the docstring was written on by devtechedge · Pull Request #342 · mkdocstrings/python · GitHub

Open Graph Title: fix: Expand relative cross-references against the object the docstring was written on by devtechedge · Pull Request #342 · mkdocstrings/python

X Title: fix: Expand relative cross-references against the object the docstring was written on by devtechedge · Pull Request #342 · mkdocstrings/python

Description: With inherited_members enabled, the docstring of a base class member is rendered in the docs of the inheriting class. In AutorefsHook.expand_identifier, leading-dot relative cross-references found in such docstrings walk up from current_object, which for an inherited member is a Griffe alias living under the inheriting class. A reference written on pkga.sub.Base.MAPPING therefore expands to pkgb.Thing in the docs of a package that subclasses Base, instead of pkga.Thing, silently linking to a wrong target or aborting strict builds when the consumer has relative_crossrefs disabled. This change anchors the dot-walk on the docstring's parent, the object the docstring was actually written on, when that object is reachable, and falls back to the current object otherwise. This mirrors how get_context already uses docstring.parent for source location. The reproducer and root-cause analysis in #341 describe exactly this behavior, including the frequenz-sdk build failure against frequenz-quantities. A regression test in tests/test_rendering.py builds two in-memory modules with cross-module inheritance and asserts a ....Thing reference in an inherited member's docstring expands to pkga.Thing; it fails on main and passes with this change. A control assertion also checks that non-inherited objects still expand identically. Re-export aliases are anchored uniformly by this change: since docstring.parent of a re-export alias points at the private defining object, relative references there now expand against it. If different treatment is preferred for re-exports, happy to follow maintainer guidance. Whether the consumer's relative_crossrefs setting should gate expansion of a dependency's docstring at all is out of scope for this PR. Fixes #341

Open Graph Description: With inherited_members enabled, the docstring of a base class member is rendered in the docs of the inheriting class. In AutorefsHook.expand_identifier, leading-dot relative cross-references found ...

X Description: With inherited_members enabled, the docstring of a base class member is rendered in the docs of the inheriting class. In AutorefsHook.expand_identifier, leading-dot relative cross-references found ...

Opengraph URL: https://github.com/mkdocstrings/python/pull/342

X: @github

direct link

Domain: redirect.github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:096246a6-b03a-a4a1-6026-bdcdf02aa65b
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idC63E:2E5258:30538F:435CD6:6AF844D6
html-safe-noncea458c3ec821d72c9522ea748c3d9c152341aebbee5e5c373690f1204dc259f15
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNjNFOjJFNTI1ODozMDUzOEY6NDM1Q0Q2OjZBRjg0NEQ2IiwidmlzaXRvcl9pZCI6IjMzNDI0MDUwNTU0NzM1MzQxNjYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmaca83eb5e48ec094ef1b2e8a807889f8737c36747fb25c6d038080a5156158362d
hovercard-subject-tagpull_request:4521334715
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/mkdocstrings/python/pull/342/files
twitter:imagehttps://avatars.githubusercontent.com/u/294291171?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/294291171?s=400&v=4
og:image:altWith inherited_members enabled, the docstring of a base class member is rendered in the docs of the inheriting class. In AutorefsHook.expand_identifier, leading-dot relative cross-references found ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None5713ecd83001b2f55c3509fb7a292bf7d66d0f167c7ae87a9f7eaec5a52bf8db
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/mkdocstrings/python git https://github.com/mkdocstrings/python.git
octolytics-dimension-user_id75664361
octolytics-dimension-user_loginmkdocstrings
octolytics-dimension-repository_id422878404
octolytics-dimension-repository_nwomkdocstrings/python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id422878404
octolytics-dimension-repository_network_root_nwomkdocstrings/python
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release653be32ff5c755082a4db662491bfbbcfc9112c1
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://redirect.github.com/mkdocstrings/python/pull/342/files#start-of-content
https://redirect.github.com/
Sign inhttps://redirect.github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmkdocstrings%2Fpython%2Fpull%2F342%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://redirect.github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmkdocstrings%2Fpython%2Fpull%2F342%2Ffiles
Sign uphttps://redirect.github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=mkdocstrings%2Fpython
Reloadhttps://redirect.github.com/mkdocstrings/python/pull/342/files
Reloadhttps://redirect.github.com/mkdocstrings/python/pull/342/files
Reloadhttps://redirect.github.com/mkdocstrings/python/pull/342/files
mkdocstringshttps://redirect.github.com/mkdocstrings
pythonhttps://redirect.github.com/mkdocstrings/python
Codehttps://redirect.github.com/mkdocstrings/python
Issues6 (6)https://redirect.github.com/mkdocstrings/python/issues
Pull requestshttps://redirect.github.com/mkdocstrings/python/pulls
Discussionshttps://redirect.github.com/mkdocstrings/python/discussions
Actionshttps://redirect.github.com/mkdocstrings/python/actions
Security and qualityhttps://redirect.github.com/mkdocstrings/python/security
Insightshttps://redirect.github.com/mkdocstrings/python/pulse
Sign up for GitHub https://redirect.github.com/signup?return_to=%2Fmkdocstrings%2Fpython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://redirect.github.com/login?return_to=%2Fmkdocstrings%2Fpython%2Fissues%2Fnew%2Fchoose
pawamoyhttps://redirect.github.com/pawamoy
mkdocstrings:mainhttps://redirect.github.com/mkdocstrings/python/tree/main
devtechedge:fix/inherited-relative-crossrefshttps://redirect.github.com/devtechedge/python/tree/fix/inherited-relative-crossrefs
Conversation 6 https://redirect.github.com/mkdocstrings/python/pull/342
Commits 1 https://redirect.github.com/mkdocstrings/python/pull/342/commits
Checks 33 https://redirect.github.com/mkdocstrings/python/pull/342/checks
Files changed https://redirect.github.com/mkdocstrings/python/pull/342/files
Please reload this pagehttps://redirect.github.com/mkdocstrings/python/pull/342/files
fix: Expand relative cross-references against the object the docstring was written on https://redirect.github.com/mkdocstrings/python/pull/342/files#top
Show all changes 1 commit https://redirect.github.com/mkdocstrings/python/pull/342/files
70996f3 fix: Expand relative cross-references against the object the docstrin… devtechedge Sep 13, 2026 https://redirect.github.com/mkdocstrings/python/pull/342/commits/70996f3935c326c2342469c52e3a3209c8612853
Clear filters https://redirect.github.com/mkdocstrings/python/pull/342/files
Please reload this pagehttps://redirect.github.com/mkdocstrings/python/pull/342/files
Please reload this pagehttps://redirect.github.com/mkdocstrings/python/pull/342/files
rendering.py https://redirect.github.com/mkdocstrings/python/pull/342/files#diff-1ccbf30e401944525f251064ddfa4089853f665a175f64b18317c942a71547a0
test_rendering.py https://redirect.github.com/mkdocstrings/python/pull/342/files#diff-530cd1c39b1adde7f11281b896978de50dae64009a7589c4f3c5ede8c76f1005
src/mkdocstrings_handlers/python/_internal/rendering.pyhttps://redirect.github.com/mkdocstrings/python/pull/342/files#diff-1ccbf30e401944525f251064ddfa4089853f665a175f64b18317c942a71547a0
View file https://redirect.github.com/devtechedge/python/blob/70996f3935c326c2342469c52e3a3209c8612853/src/mkdocstrings_handlers/python/_internal/rendering.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://redirect.github.com/mkdocstrings/python/pull/342/{{ revealButtonHref }}
https://redirect.github.com/mkdocstrings/python/pull/342/files#diff-1ccbf30e401944525f251064ddfa4089853f665a175f64b18317c942a71547a0
https://redirect.github.com/mkdocstrings/python/pull/342/files#diff-1ccbf30e401944525f251064ddfa4089853f665a175f64b18317c942a71547a0
tests/test_rendering.pyhttps://redirect.github.com/mkdocstrings/python/pull/342/files#diff-530cd1c39b1adde7f11281b896978de50dae64009a7589c4f3c5ede8c76f1005
View file https://redirect.github.com/devtechedge/python/blob/70996f3935c326c2342469c52e3a3209c8612853/tests/test_rendering.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://redirect.github.com/mkdocstrings/python/pull/342/{{ revealButtonHref }}
https://redirect.github.com/mkdocstrings/python/pull/342/files#diff-530cd1c39b1adde7f11281b896978de50dae64009a7589c4f3c5ede8c76f1005
https://redirect.github.com/mkdocstrings/python/pull/342/files#diff-530cd1c39b1adde7f11281b896978de50dae64009a7589c4f3c5ede8c76f1005
https://redirect.github.com/mkdocstrings/python/pull/342/files#diff-530cd1c39b1adde7f11281b896978de50dae64009a7589c4f3c5ede8c76f1005
Please reload this pagehttps://redirect.github.com/mkdocstrings/python/pull/342/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.