Skip to content

Commit 5cf7899

Browse files
committed
Styling
1 parent e779f87 commit 5cf7899

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

mypy/semanal.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,7 +1152,10 @@ def analyze_class(self, defn: ClassDef) -> None:
11521152
# update the typevar ids such that they will not conflict with any base classes
11531153
# (yuck, there has to be a better way to do this.)
11541154
if any(isinstance(base[0], Instance) for base in base_types):
1155-
offset = max(self.find_maximum_class_id(base[0].type) for base in base_types if isinstance(base[0], Instance))
1155+
offset = max(
1156+
self.find_maximum_class_id(base[0].type)
1157+
for base in base_types if isinstance(base[0], Instance)
1158+
)
11561159
# mutating the type vars to be what we want (and hoping nothing previously saved them)
11571160
for tvar in tvar_defs:
11581161
tvar.id.raw_id += offset
@@ -1191,13 +1194,16 @@ def analyze_class(self, defn: ClassDef) -> None:
11911194
self.analyze_class_decorator(defn, decorator)
11921195
self.analyze_class_body_common(defn)
11931196

1194-
# should this be memoized in TypeInfo??
1197+
# should this be memoized in TypeInfo?
11951198
def find_maximum_class_id(self, info: TypeInfo) -> int:
11961199
# top class?
11971200
if len(info.mro) in (0, 1):
11981201
return len(info.type_vars)
11991202
else:
1200-
return len(info.type_vars) + max(self.find_maximum_class_id(cls) for cls in info.mro[1:])
1203+
return len(info.type_vars) + max(
1204+
self.find_maximum_class_id(cls)
1205+
for cls in info.mro[1:]
1206+
)
12011207

12021208
def is_core_builtin_class(self, defn: ClassDef) -> bool:
12031209
return self.cur_mod_id == 'builtins' and defn.name in CORE_BUILTIN_CLASSES

0 commit comments

Comments
 (0)