Skip to content

use _value2member_map_ for enum value check (Python 3.11 compatibility) - #25

Closed
chobitsfan wants to merge 1 commit into
openmv:masterfrom
chobitsfan:fix_py_3_11
Closed

chobitsfan wants to merge 1 commit into
openmv:masterfrom
chobitsfan:fix_py_3_11

Conversation

@chobitsfan

Copy link
Copy Markdown

The in operator for Enum classes was updated to support value lookups, but in 3.11 and earlier it raises a TypeError: unsupported operand type(s) for 'in': 'int' and 'EnumType'.

3.11 is the latest python version for Raspberry Pi Bookworm / Debian 12.

Tested on a Raspberry Pi (Bookworm / Debian 12, Python 3.11) and a laptop (Ubuntu 24.04, Python 3.12)

@kwagyeman
kwagyeman requested a review from iabdalkader October 26, 2026 20:05
@kwagyeman kwagyeman added this to the v1.0.8 milestone Oct 26, 2026
@kwagyeman

Copy link
Copy Markdown
Member

@iabdalkader - I've run into this issue many times while installing this library on various machines. We should fix it, too.

@iabdalkader

Copy link
Copy Markdown
Member

I'll take a look. Sorry, I wasn't following this repo for some reason, so never got notifications.

@iabdalkader

Copy link
Copy Markdown
Member

This uses a private member, so I fixed it differently. See #31

@iabdalkader iabdalkader closed this Nov 8, 2026
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.

3 participants