René's URL Explorer Experiment


Title: Import of submodule shadowing parent module attribute fails under lazy_imports mode · Issue #151208 · python/cpython · GitHub

Open Graph Title: Import of submodule shadowing parent module attribute fails under lazy_imports mode · Issue #151208 · python/cpython

X Title: Import of submodule shadowing parent module attribute fails under lazy_imports mode · Issue #151208 · python/cpython

Description: Bug report Bug description: For this module structure: └─ a/ ├─ __init__.py # Contains a function foo() └─ foo.py This script passes on 3.14: (edited: removed unnecessary from ... line) import a.foo import types assert isinstance(a.foo, ...

Open Graph Description: Bug report Bug description: For this module structure: └─ a/ ├─ __init__.py # Contains a function foo() └─ foo.py This script passes on 3.14: (edited: removed unnecessary from ... line) import a.fo...

X Description: Bug report Bug description: For this module structure: └─ a/ ├─ __init__.py # Contains a function foo() └─ foo.py This script passes on 3.14: (edited: removed unnecessary from ... line) import a.fo...

Opengraph URL: https://github.com/python/cpython/issues/151208

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Import of submodule shadowing parent module attribute fails under lazy_imports mode","articleBody":"# Bug report\n\n### Bug description:\n\nFor this module structure:\n```\n└─ a/\n   ├─ __init__.py    # Contains a function foo()\n   └─ foo.py\n```\nThis script passes on 3.14: (edited: removed unnecessary `from ... ` line)\n```python\nimport a.foo\nimport types\nassert isinstance(a.foo, types.ModuleType), type(a.foo)\n```\nAnd fails on 3.15 with lazy imports (`python3.15 -X lazy_imports=all script.py`):\n```py\nTraceback (most recent call last):\n  File \"/Users/jwalls/script.py\", line 3, in \u003cmodule>\n    assert isinstance(a.foo, types.ModuleType), type(a.foo)\n           ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: \u003cclass 'function'>\n```\n\n\n### CPython versions tested on:\n\n3.15\n\n### Operating systems tested on:\n\nmacOS","author":{"url":"https://github.com/jacobtylerwalls","@type":"Person","name":"jacobtylerwalls"},"datePublished":"2026-06-09T20:07:26Z","url":"https://github.com/python/cpython/issues/151208"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:b4345632-1850-e2d7-0b2b-3e3864fcd7bb
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC9E4:BB75:153AC39:1C1D28C:6B01FE70
html-safe-nonced3eb663fe0bcd42290fff4ab6f4318b13ff78009d0bde43a3f026482fc5336ba
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOUU0OkJCNzU6MTUzQUMzOToxQzFEMjhDOjZCMDFGRTcwIiwidmlzaXRvcl9pZCI6IjI2ODYxNjMzMTQyNTc1NTkxNTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacb9cff77487125aee7ed9d011bdbcf6a6b9b5866dd022ba37dc0c86174c803b0c
hovercard-subject-tagissue:4625221139
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/151208/issue_layout
twitter:imagehttps://opengraph.githubassets.com/b00a9c786f230b47b57d0fe09cc817ee327ec7f3973ba873157edcd1e7773861/python/cpython/issues/151208
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/b00a9c786f230b47b57d0fe09cc817ee327ec7f3973ba873157edcd1e7773861/python/cpython/issues/151208
og:image:altBug report Bug description: For this module structure: └─ a/ ├─ __init__.py # Contains a function foo() └─ foo.py This script passes on 3.14: (edited: removed unnecessary from ... line) import a.fo...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamejacobtylerwalls
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/cpython/issues/151208#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F151208
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://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F151208
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/151208
Reloadhttps://github.com/python/cpython/issues/151208
Reloadhttps://github.com/python/cpython/issues/151208
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.4k (2.4k)https://github.com/python/cpython/pulls
Actionshttps://github.com/python/cpython/actions
Projectshttps://github.com/python/cpython/projects
Security and qualityhttps://github.com/python/cpython/security
Insightshttps://github.com/python/cpython/insights
https://github.com/python/cpython
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/151208
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/151208
Import of submodule shadowing parent module attribute fails under lazy_imports modehttps://github.com/python/cpython/issues/151208#top
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
topic-lazy-importshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-lazy-imports%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com/jacobtylerwalls
jacobtylerwallshttps://github.com/jacobtylerwalls
on Jun 9, 2026https://github.com/python/cpython/issues/151208#issue-4625221139
jacobtylerwallshttps://github.com/jacobtylerwalls
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
on Jun 9, 2026https://github.com/python/cpython/issues/151208#event-26541341241
hugovkhttps://github.com/hugovk
topic-lazy-importshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-lazy-imports%22
on Jun 9, 2026https://github.com/python/cpython/issues/151208#event-26541645496
https://github.com/harjothkhara
harjothkharahttps://github.com/harjothkhara
on Jun 10, 2026https://github.com/python/cpython/issues/151208#issuecomment-4665860221
ce916dchttps://github.com/python/cpython/commit/ce916dc50644bb1de940f5fb580bd9907cceb959
Python/import.c#L4601https://github.com/python/cpython/blob/ce916dc50644bb1de940f5fb580bd9907cceb959/Python/import.c#L4601
Objects/moduleobject.chttps://github.com/python/cpython/blob/ce916dc50644bb1de940f5fb580bd9907cceb959/Objects/moduleobject.c#L1330-L1395
L1377https://github.com/python/cpython/blob/ce916dc50644bb1de940f5fb580bd9907cceb959/Objects/moduleobject.c#L1377
L1393https://github.com/python/cpython/blob/ce916dc50644bb1de940f5fb580bd9907cceb959/Objects/moduleobject.c#L1393
gh-144957https://github.com/python/cpython/issues/144957
gh-150052https://github.com/python/cpython/issues/150052
Avasamhttps://github.com/Avasam
on Jun 12, 2026https://github.com/python/cpython/issues/151208#event-26692831630
add ref python/cpython#151208https://github.com/Toufool/AutoSplit/commit/1e22413cb35912c3b68eb41d73907227edf122cc
python/cpython#151208https://github.com/python/cpython/issues/151208
1e22413https://github.com/Toufool/AutoSplit/commit/1e22413cb35912c3b68eb41d73907227edf122cc
picnixzhttps://github.com/picnixz
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
on Jun 13, 2026https://github.com/python/cpython/issues/151208#event-26711677256
https://github.com/harjothkhara
harjothkharahttps://github.com/harjothkhara
on Jun 16, 2026https://github.com/python/cpython/issues/151208#issuecomment-4724423761
Python/import.c:4422https://github.com/python/cpython/blob/c2ca7724af94df6e078a4b2e86d1be8c410d9940/Python/import.c#L4422
register_lazy_on_parent, Python/import.c:4364https://github.com/python/cpython/blob/c2ca7724af94df6e078a4b2e86d1be8c410d9940/Python/import.c#L4364
Objects/moduleobject.c:1377https://github.com/python/cpython/blob/c2ca7724af94df6e078a4b2e86d1be8c410d9940/Objects/moduleobject.c#L1377
Python/bytecodes.c:2951https://github.com/python/cpython/blob/c2ca7724af94df6e078a4b2e86d1be8c410d9940/Python/bytecodes.c#L2951
PEP-810https://peps.python.org/810
Python/import.c:5618https://github.com/python/cpython/blob/c2ca7724af94df6e078a4b2e86d1be8c410d9940/Python/import.c#L5618
brittanyreyhttps://github.com/brittanyrey
on Sep 18, 2026https://github.com/python/cpython/issues/151208#event-31365704790
Import a lazy submodule that a package attribute shadowshttps://github.com/brittanyrey/cpython/commit/00da645b54d6a0fef2f5d27ceabb9c0d57364093
00da645https://github.com/brittanyrey/cpython/commit/00da645b54d6a0fef2f5d27ceabb9c0d57364093
Import a lazy submodule that a package attribute shadowshttps://github.com/brittanyrey/cpython/commit/2b0aa85fc9308bc3be46c2910d79f24390289289
2b0aa85https://github.com/brittanyrey/cpython/commit/2b0aa85fc9308bc3be46c2910d79f24390289289
https://github.com/jacobtylerwalls
jacobtylerwallshttps://github.com/jacobtylerwalls
on Oct 1, 2026https://github.com/python/cpython/issues/151208#issuecomment-5938922646
dffac61https://github.com/python/cpython/commit/dffac6163e693cf80ed42cdc8e2cb5c0cb9577d7
https://github.com/jacobtylerwalls
jacobtylerwallshttps://github.com/jacobtylerwalls
on Oct 7, 2026https://github.com/python/cpython/issues/151208#issuecomment-6030996990
dffac61https://github.com/python/cpython/commit/dffac6163e693cf80ed42cdc8e2cb5c0cb9577d7
00a1c3ahttps://github.com/python/cpython/commit/00a1c3a0c94401095510a7022002f12bad118fbb
@hugovkhttps://github.com/hugovk
dffac61https://github.com/python/cpython/commit/dffac6163e693cf80ed42cdc8e2cb5c0cb9577d7
https://github.com/hugovk
hugovkhttps://github.com/hugovk
on Oct 9, 2026https://github.com/python/cpython/issues/151208#issuecomment-6078491604
dffac61https://github.com/python/cpython/commit/dffac6163e693cf80ed42cdc8e2cb5c0cb9577d7
@pablogsalhttps://github.com/pablogsal
@brittanyreyhttps://github.com/brittanyrey
https://github.com/pablogsal
pablogsalhttps://github.com/pablogsal
on Oct 9, 2026https://github.com/python/cpython/issues/151208#issuecomment-6079692109
@brittanyreyhttps://github.com/brittanyrey
kevinprimeraquecreo-stackhttps://github.com/kevinprimeraquecreo-stack
Project_VKhttps://github.com/users/kevinprimeraquecreo-stack/projects/1
on Oct 18, 2026https://github.com/python/cpython/issues/151208#event-33592116399
github-project-automationhttps://github.com/apps/github-project-automation
Project_VKhttps://github.com/users/kevinprimeraquecreo-stack/projects/1
on Oct 18, 2026https://github.com/python/cpython/issues/151208
kevinprimeraquecreo-stackhttps://github.com/kevinprimeraquecreo-stack
Project_VKhttps://github.com/users/kevinprimeraquecreo-stack/projects/1
on Oct 18, 2026https://github.com/python/cpython/issues/151208#event-33592172308
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/151208
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/151208
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
topic-lazy-importshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-lazy-imports%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
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.