We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ba435ac commit f2cc574Copy full SHA for f2cc574
mypy/semanal_enum.py
@@ -143,6 +143,12 @@ def build_enum_call_typeinfo(
143
var = Var(item)
144
var.info = info
145
var.is_property = True
146
+ # When an enum is created by its functional form `Enum(name, values)`
147
+ # - if it is a string it is first split by commas/whitespace
148
+ # - if it is an iterable of single items each item is assigned a value starting at `start`
149
+ # - if it is an iterable of (name, value) then the given values will be used
150
+ # either way, each item should be treated as if it has an explicit value.
151
+ var.has_explicit_value = True
152
var._fullname = f"{info.fullname}.{item}"
153
info.names[item] = SymbolTableNode(MDEF, var)
154
return info
0 commit comments