Skip to content

Fix AttributeError: 'EarlyPython' object has no attribute 'hide'#22

Merged
cnfatal merged 4 commits into
mainfrom
copilot/fix-earlypython-hide-attribute
May 26, 2026
Merged

Fix AttributeError: 'EarlyPython' object has no attribute 'hide'#22
cnfatal merged 4 commits into
mainfrom
copilot/fix-earlypython-hide-attribute

Conversation

Copilot AI commented May 26, 2026

Copy link
Copy Markdown
Contributor
  • Survey existing docstrings in ast.py to understand current style
  • Add grammar docstrings to all nodes that were missing them:
    • Say: added grammar BNF and examples
    • Label: expanded with grammar BNF and hide example
    • Python: moved URL to class docstring; added grammar BNF and examples
    • EarlyPython: added class-level docstring with grammar BNF and examples
    • Image: moved docstring to class level; added grammar BNF
    • Show: added class docstring with grammar BNF and examples
    • Hide: added class docstring with grammar BNF and examples
    • With: added class docstring with grammar BNF and examples
    • Return: added class docstring with grammar BNF and examples
    • If: added class docstring with grammar BNF and examples
    • Define: moved free-standing comment into class docstring; added grammar BNF
    • Default: added class docstring with grammar BNF and examples
    • Screen: moved free-standing comment into class docstring; added grammar BNF
    • TranslatePython: added class docstring with grammar BNF and example
  • All 43 tests pass

Use util.attr() for safe attribute access in EarlyPython.get_code()
instead of directly accessing self.hide which may not exist in older
serialized rpyc files. Add regression test.

Fixes: AttributeError: 'EarlyPython' object has no attribute 'hide'

Agent-Logs-Url: https://github.com/cnfatal/rpycdec/sessions/3624a670-a786-4ba5-b5d5-2214f3d38efa

Co-authored-by: cnfatal <15731850+cnfatal@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix AttributeError for EarlyPython hide attribute Fix AttributeError: 'EarlyPython' object has no attribute 'hide' May 26, 2026
Copilot AI requested a review from cnfatal May 26, 2026 02:48
Per Ren'Py's parser grammar (python [early] [hide] [in <store>]:),
'hide' must appear before 'in <store>'. Both get_code() methods were
emitting them in the wrong order. Update tests to assert correct order.

Agent-Logs-Url: https://github.com/cnfatal/rpycdec/sessions/8168cb24-e9d5-4c98-a5a7-839b055d5e4a

Co-authored-by: cnfatal <15731850+cnfatal@users.noreply.github.com>
Document Say, Label, Python, EarlyPython, Image, Show, Hide, With,
Return, If, Define, Default, Screen, and TranslatePython with their
Ren'Py grammar BNF and usage examples, following the existing
docstring style in the file.

Agent-Logs-Url: https://github.com/cnfatal/rpycdec/sessions/b10dc9dc-6cf7-46e3-9ec7-5cc62c8a64fc

Co-authored-by: cnfatal <15731850+cnfatal@users.noreply.github.com>
@cnfatal

cnfatal commented May 26, 2026

Copy link
Copy Markdown
Owner

@copilot squash commits

Copilot AI commented May 26, 2026

Copy link
Copy Markdown
Contributor Author

@copilot squash commits

I squashed the 4 commits into one locally, but force-pushing to update the branch history isn't available through the tooling I have access to. You can run git rebase -i HEAD~4 on the branch (or git reset --soft HEAD~4 && git commit then git push --force-with-lease) to perform the squash on your end.

@cnfatal cnfatal marked this pull request as ready for review May 26, 2026 03:05
@cnfatal cnfatal merged commit 48d3275 into main May 26, 2026
1 check passed
@cnfatal cnfatal deleted the copilot/fix-earlypython-hide-attribute branch May 26, 2026 03:05
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.

AttributeError: 'EarlyPython' object has no attribute 'hide'

2 participants