Skip to content

Conversation

YosefAshenafi
Copy link
Contributor

Changes

  • Introduced display class method in HtkIntFlag to convert combined flag values into a list of human-readable names.
  • Updated docstring for HtkIntFlag to reflect the new functionality.

This enhancement improves usability by allowing easier interpretation of combined flag values.

## Changes
- Introduced `display` class method in `HtkIntFlag` to convert combined flag values into a list of human-readable names.
- Updated docstring for `HtkIntFlag` to reflect the new functionality.

This enhancement improves usability by allowing easier interpretation of combined flag values.
@YosefAshenafi YosefAshenafi self-assigned this Oct 22, 2025
utils/enums.py Outdated
"""

@classmethod
def display(cls, int_value):
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
def display(cls, int_value):
def display(cls, int_value) -> list[str]:

## Changes
- Modified the `display` method in `HtkIntFlag` to include a return type annotation of `list[str]`.
- Enhanced the docstring with an example of how to use the `display` method with a sample class.

This change improves code clarity and type safety.
utils/enums.py Outdated
return result

@classmethod
def list_flags(cls, int_value):
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
def list_flags(cls, int_value):
def list_flags(cls, int_value) -> list[HtkIntFlag]:

Or list['HtkIntFlag']

## Changes
- Updated the `list_flags` method in `HtkIntFlag` to specify a return type of `list[HtkIntFlag]`.
- Enhanced the method's docstring for improved clarity.

This change enhances code readability and type safety.
@jontsai jontsai merged commit 8b6899e into hacktoolkit:master Oct 22, 2025
@jontsai jontsai deleted the enum-update-for-exercise branch October 22, 2025 21:03
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