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

MNT: appease newer python by not using enum to index into tuple #1200

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nstelter-slac
Copy link
Collaborator

@nstelter-slac nstelter-slac commented Mar 14, 2025

Seems like the newer python im running pyside6 on doesn't like using enums to index into a tuple: "TypeError: tuple indices must be integers or slices, not LayoutType"

so use a map for 'layout_class_for_type' instead. (using the enum's '.value' should allow for indexing into the tuple too, but imo using the map is more readable.)

this works fine still older python

@nstelter-slac nstelter-slac added the pyside6 for adding pyside6 (qt6) support label Mar 14, 2025
@nstelter-slac nstelter-slac changed the title MNT: appease python by not using enum to index into tuple MNT: appease newer python by not using enum to index into tuple Mar 14, 2025
Seems like the newer python im running pyside6 on doesn't like using enums to index into a tuple:
"TypeError: tuple indices must be integers or slices, not LayoutType"

so use a map for 'layout_class_for_type' instead. (using the enum's '.value' should
allow for indexing into the tuple too, but imo using the map is more readable.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pyside6 for adding pyside6 (qt6) support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant