Skip to content

Conversation

@CoolCat467
Copy link
Contributor

In this pull request, we fix type issues as reported by mypy.

Copy link
Owner

@jorio jorio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this PR! Please see a few comments in my review.
Annotating the serialization/deserialization code is a bit tricky.


class JSONEncoderBase16Fallback(json.JSONEncoder):
def default(self, o: Any):
__slots__ = ()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think __slots__ are worth the maintenance overhead in a small project like this. Does mypy need them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, but mypy will give you warnings when accessing attributes that don't exist in slots, and Python will use memory more efficiently when objects have __slots__ defined

Co-authored-by: Iliyas Jorio <iliyas@jor.io>
@CoolCat467 CoolCat467 requested a review from jorio February 9, 2025 23:20
@CoolCat467 CoolCat467 requested a review from jorio February 10, 2025 22:44
@jorio
Copy link
Owner

jorio commented Feb 16, 2025

Thank you for these fixes!

There seems to be an issue somewhere in the PR that prevents PICT resources from being converted. For example, Nanosaur 1's Application.rsrc has 3 PICT resources (128, 129, 130). On the master branch, rsrcdump -x Application.rsrc can convert these to PNG files, but this doesn't work anymore. Could you please look into it?

(Sorry for the inconvenience – I really ought to write a proper test suite for this tool.)

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