Skip to content

Commit 1cedcf9

Browse files
committed
fixup
1 parent dd079fb commit 1cedcf9

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

mypy/plugins/enums.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -184,16 +184,10 @@ class SomeEnum:
184184
if _implements_new(info):
185185
return ctx.default_attr_type
186186

187-
stnodes = (info.get(name) for name in info.enum_members)
188-
189187
# Enums _can_ have methods, instance attributes, and `nonmember`s.
190188
# Omit methods and attributes created by assigning to self.*
191189
# for our value inference.
192-
node_types = (
193-
get_proper_type(n.type) if n else None
194-
for n in stnodes
195-
if n is None or not n.implicit
196-
)
190+
node_types = (get_proper_type(info[name].type) for name in info.enum_members)
197191
proper_types = [_infer_value_type_with_auto_fallback(ctx, t) for t in node_types]
198192
underlying_type = _first(proper_types)
199193
if underlying_type is None:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy