Skip to content

Is there a need for enumasint or intasenum? #356

@zjp

Description

@zjp

One thing we've done in ChimeraX is standardize on using integers instead of enum values as they exist in PyQt6 which poses a challenge because we're still thinking about whether we want to use that or PySide6.

We have two utility functions, qt_enum_as_int and qt_int_as_enum, to help us achieve the flexibility we need. For other packages (PyQt5, pyside2, pyside6) that don't use enums, we test whether the input is a subclass of enum.Enum and return the input if it isn't.

Does that sound like something that would be useful in compat.py?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions