Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Represent features using primitive types and IntEnum/StrEnum instead of immutable Enums for extensibility #511

Open
alchzh opened this issue Nov 6, 2024 · 0 comments

Comments

@alchzh
Copy link
Collaborator

alchzh commented Nov 6, 2024

What is the use case for the feature?

Adding new feature support to ofrak and ofrak_patch_maker should not require forking this repository to modify internal types or hacking together fake Enum member objects. We should use bare Enum when it's suitably internal and not intended to be extensible or it's possible to actually enumerate all possible options (endianness, memory permissions, etc. probably qualify here).

Example of Enums that shouldn't be

  • ElfSectionType
  • ElfProgramHeaderType
  • Every Enum in ofrak_type.architecture

Does the feature contain any proprietary information about another company's intellectual property?

No.

How would you implement this feature?

Changing "feature" Enums to inherit from StrEnum or IntEnum and update typedefs in consuming classes/methods to str or int.

Are you interested in implementing it yourself?

Yes.

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

No branches or pull requests

1 participant