Skip to content

Docs: explain that modules.MODULE is a context name, not an import path (#729) - #903

Merged
craigbarratt merged 1 commit into
custom-components:masterfrom
HoneyBearTech:docs-context-names-729
Nov 20, 2026
Merged

craigbarratt merged 1 commit into
custom-components:masterfrom
HoneyBearTech:docs-context-names-729

Conversation

@HoneyBearTech

@HoneyBearTech HoneyBearTech commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Closes #729

What was confusing
The global context table in the reference docs lists names like modules.MODULE. That reads as if a module could be imported that way, but import modules.MODULE fails. The right
form is import MODULE.

What I changed
I added a short paragraph under the table in docs/reference.rst. It says these names are internal names for each global context, used in logging, reloads and the global context
functions. They aren't import paths, and a module in pyscript/modules/MODULE.py is imported with import MODULE. It links to the Importing section.

Testing
Docs-only change. I checked the link target, and the test suite still passes.

…components#729)

The global context table lists names like modules.MODULE, which reads
as if a module could be imported that way. Say that these names are
only used for logging, reloads and the global context functions, and
that a module is imported with "import MODULE".

Signed-off-by: Sean Stoube <31805425+HoneyBearTech@users.noreply.github.com>
@HoneyBearTech HoneyBearTech changed the title docs: clarify that global context names are not import paths (#729) Docs: explain that modules.MODULE is a context name, not an import path (#729) Nov 19, 2026

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

Thanks @HoneyBearTech! This is accurate and clears up the confusion in #729. I built the docs: no new warnings, and the Importing_ link resolves.

@craigbarratt
craigbarratt merged commit 4294b77 into custom-components:master Nov 20, 2026
5 checks passed
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.

Global context docs appear incorrect

2 participants