You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The new enum.verify decorator isn't supported: the following snippet will raise an exception at runtime on 3.11 due to not all values being unique, but it passes mypy:
enum.member/enum.nonmember. The docs are a bit thin on these, but it looks like in the following enum, BAR is converted to become a member, but BAZ
is not:
ReprEnum: this doesn't need any special support by mypy, but the following mypy bug but means that it can't really be used idiomatically at the moment:
Activity
Correctly handle Enum name on Python 3.11 (#14133)
electric-coder commentedon May 30, 2023
There are 83 open Enum mypy issues at the the time of this writing.
Getting the Enum datatype to work with mypy is becoming impossible as I find myself having to use
cast()in at least every other line.electric-coder commentedon Dec 28, 2023
@AlexWaygood there's also Enum's
_new_member_that hasn't been mentioned in the docs nor in the mypy repository.Support `enum.nonmember` for python3.11+ (#17376)
CoolCat467 commentedon Jun 16, 2024
With #17376 being merged we should be able to check off
enum.nonmember, no?AlexWaygood commentedon Jun 16, 2024
Done
CoolCat467 commentedon Dec 15, 2025
As far as I understand it, would
StrEnumbe checked off now that #18587 was merged?