Skip to content

Fix incorrect type annotations#22

Merged
RoadrunnerWMC merged 3 commits intoRoadrunnerWMC:masterfrom
mike8699:fix-types
Mar 25, 2025
Merged

Fix incorrect type annotations#22
RoadrunnerWMC merged 3 commits intoRoadrunnerWMC:masterfrom
mike8699:fix-types

Conversation

@mike8699
Copy link
Copy Markdown
Contributor

It seems some of the type annotations I added in #16 and #18 were incorrect. I discovered this after upgrading my project to use ndspy 4.2.0, and it started failing type checking (PR, failed mypy CI run).

I confirmed the decompress return type is bytearray by calling it on a compressed ARM9 bytes object and calling type() on it. The type of Overlay.data is easily confirmed as a bytearray by looking at the __init__ constructor for that class.

mike8699 added a commit to phst-randomizer/ph-randomizer that referenced this pull request Sep 29, 2024
Temporary measure until RoadrunnerWMC/ndspy#22
is merged.
mike8699 added a commit to phst-randomizer/ph-randomizer that referenced this pull request Dec 28, 2024
Temporary measure until RoadrunnerWMC/ndspy#22
is merged.
@RoadrunnerWMC
Copy link
Copy Markdown
Owner

Thanks! And sorry for the long delay on my part.

For decompress, I'd prefer to keep the function contract as bytes rather than bytearray, so I opted to add a conversion at the end instead of changing the signature.

I also noticed similar bytes-vs-bytearray problems in saveOverlayTable() and MainCodeFile.data, so I fixed those too.

@RoadrunnerWMC RoadrunnerWMC merged commit 3406a21 into RoadrunnerWMC:master Mar 25, 2025
16 of 17 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.

2 participants