Skip to content

Plan: rebase the nested class fix (#907) and reword one test docstring - #6

Open
honeybeartech-homelab-automation[bot] wants to merge 3 commits into
team/nested-class-rebase-basefrom
team/nested-class-rebase
Open

honeybeartech-homelab-automation[bot] wants to merge 3 commits into
team/nested-class-rebase-basefrom
team/nested-class-rebase

Conversation

@honeybeartech-homelab-automation

@honeybeartech-homelab-automation honeybeartech-homelab-automation Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

This PR holds the plan for the follow-up on upstream custom-components/pyscript#907, the nested class fix. It stays on this fork and is never merged. Full plan and record: docs/plans/nested-class-rebase.md. Its base is a copy of upstream's latest master, so this PR shows only our changes.

What the maintainer asked for on custom-components#907: update it to current master (it showed a conflict), and reword one test's description so it says the test records today's pyscript behaviour, which differs from Python.

What's done: the fix now sits on upstream's latest code. Only the test file had a conflict: new upstream tests and ours had both been added at its end, so we kept both. The fix itself is unchanged. The test description now says it records today's behaviour, not the intended one.

Checks: all 217 tests and every code-style check the project runs pass. The security review and the independent code review found nothing.

After you approve: the new commit replaces the old one on the fork branch fix-nested-class-attr. That updates custom-components#907 directly, and GitHub should then show it as ready to merge. This plan file does not go upstream. You'll get a short reply to paste on custom-components#907, because the app can't write on the upstream repo. The maintainer may need to approve custom-components#907 once more.

Team: Engineer, Security Officer and Auditor. Research, the plan check and QA were skipped as too small for this job.

Contribution rules followed: docs/contributing.rst and tests/README.md, pre-commit (ruff, codespell, pylint, mypy), CI on Python 3.14, one small fix per PR with tests, and commits signed off.

Approve this PR (or comment "approve") to finish. Close it to throw the work away.

Signed-off-by: Sean Stoube <31805425+HoneyBearTech@users.noreply.github.com>
@honeybeartech-homelab-automation

Copy link
Copy Markdown
Author

@HoneyBearTech The plan for the custom-components#907 follow-up (rebase plus one docstring) is ready. Please approve this PR (or comment "approve") to start the work.

…#875)

A class defined inside a class body was left on the outer class as the
internal EvalLocalVar placeholder instead of the class itself. So after
the outer class was created, Outer.Inner | None raised the same
TypeError as in custom-components#875, and type(Outer.Inner()) is Outer.Inner was False.

Before the outer class is created, replace each defined EvalLocalVar in
a plain dict class namespace with the value it holds. The placeholders
themselves are left alone, so methods that read the nested class by its
bare name keep working as before. A class namespace that isn't a plain
dict, such as a mapping returned by a custom metaclass __prepare__, is
left as it is.

Signed-off-by: Sean Stoube <31805425+HoneyBearTech@users.noreply.github.com>
Signed-off-by: Sean Stoube <31805425+HoneyBearTech@users.noreply.github.com>
@honeybeartech-homelab-automation

Copy link
Copy Markdown
Author

@HoneyBearTech The custom-components#907 follow-up is built and checked, with nothing open. It's ready for your approval.

Done

The nested class fix now sits on upstream's latest code. Only the test file had a conflict: new upstream tests and ours had both been added at its end, so we kept both. The fix itself is unchanged. As the maintainer asked, the test test_nested_class_bare_name_in_method now says it records how pyscript behaves today (different from Python), so nobody takes it as the intended behaviour.

Checks

  • Engineer's run and the Auditor's run: all 217 tests pass, plus ruff, pylint, mypy and codespell, on Python 3.14. Without the fix, the five main test cases fail, so they really test it.
  • Security: clear. Only the fix commit goes upstream, not this plan.
  • Audit: approved, no findings. It also checked the fix still works with the three upstream changes merged since Store nested classes themselves on the outer class (#875) custom-components/pyscript#907 was opened.
  • Skipped: research, plan check and QA (too small for this job), and the plain-English check of this report (its monthly quota is used up).

Rejected findings

None.

After you approve

  1. The new commit replaces the old one on fix-nested-class-attr. That updates Store nested classes themselves on the outer class (#875) custom-components/pyscript#907 directly.
  2. You get a short reply to paste on Store nested classes themselves on the outer class (#875) custom-components/pyscript#907, because the app can't write on the upstream repo.

To approve

Approve this PR (or comment "approve") to finish. Close it to throw the work away.

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.

1 participant