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

Improve the handling of Enums #4671

Open
wants to merge 2 commits into
base: 0.25.3
Choose a base branch
from
Open

Conversation

ndonkoHenri
Copy link
Contributor

@ndonkoHenri ndonkoHenri commented Jan 9, 2025

This PR mainly attempts to fix #3736 (comment). The heavy enums (colors and icons) were imported in types.py, which might have been the cause.

Also, Enum vs String comparisons are now possible, ex: ft.Colors.AMBER == "amber"

Summary by Sourcery

Refactor enum handling to allow string comparison.

New Features:

  • Introduce ExtendedEnum for enhanced enum functionality.

Enhancements:

  • Change Enums to inherit from ExtendedEnum.
  • Remove unnecessary _set_enum_attr method in favor of _set_attr.
  • Update color and icon type definitions.

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.

1 participant