@@ -101,7 +101,9 @@ def build_type_map(
101
101
if mapper .type_to_ir [cdef .info ].is_ext_class :
102
102
prepare_class_def (module .path , module .fullname , cdef , errors , mapper , options )
103
103
else :
104
- prepare_non_ext_class_def (module .path , module .fullname , cdef , errors , mapper , options )
104
+ prepare_non_ext_class_def (
105
+ module .path , module .fullname , cdef , errors , mapper , options
106
+ )
105
107
106
108
# Prepare implicit attribute accessors as needed if an attribute overrides a property.
107
109
for module , cdef in classes :
@@ -168,7 +170,11 @@ def get_module_func_defs(module: MypyFile) -> Iterable[FuncDef]:
168
170
169
171
170
172
def prepare_func_def (
171
- module_name : str , class_name : str | None , fdef : FuncDef , mapper : Mapper , options : CompilerOptions
173
+ module_name : str ,
174
+ class_name : str | None ,
175
+ fdef : FuncDef ,
176
+ mapper : Mapper ,
177
+ options : CompilerOptions ,
172
178
) -> FuncDecl :
173
179
kind = (
174
180
FUNC_STATICMETHOD
@@ -182,10 +188,17 @@ def prepare_func_def(
182
188
183
189
184
190
def prepare_method_def (
185
- ir : ClassIR , module_name : str , cdef : ClassDef , mapper : Mapper , node : FuncDef | Decorator , options : CompilerOptions
191
+ ir : ClassIR ,
192
+ module_name : str ,
193
+ cdef : ClassDef ,
194
+ mapper : Mapper ,
195
+ node : FuncDef | Decorator ,
196
+ options : CompilerOptions ,
186
197
) -> None :
187
198
if isinstance (node , FuncDef ):
188
- ir .method_decls [node .name ] = prepare_func_def (module_name , cdef .name , node , mapper , options )
199
+ ir .method_decls [node .name ] = prepare_func_def (
200
+ module_name , cdef .name , node , mapper , options
201
+ )
189
202
elif isinstance (node , Decorator ):
190
203
# TODO: do something about abstract methods here. Currently, they are handled just like
191
204
# normal methods.
@@ -242,7 +255,12 @@ def can_subclass_builtin(builtin_base: str) -> bool:
242
255
243
256
244
257
def prepare_class_def (
245
- path : str , module_name : str , cdef : ClassDef , errors : Errors , mapper : Mapper , options : CompilerOptions
258
+ path : str ,
259
+ module_name : str ,
260
+ cdef : ClassDef ,
261
+ errors : Errors ,
262
+ mapper : Mapper ,
263
+ options : CompilerOptions ,
246
264
) -> None :
247
265
"""Populate the interface-level information in a class IR.
248
266
@@ -321,7 +339,13 @@ def prepare_class_def(
321
339
322
340
323
341
def prepare_methods_and_attributes (
324
- cdef : ClassDef , ir : ClassIR , path : str , module_name : str , errors : Errors , mapper : Mapper , options : CompilerOptions
342
+ cdef : ClassDef ,
343
+ ir : ClassIR ,
344
+ path : str ,
345
+ module_name : str ,
346
+ errors : Errors ,
347
+ mapper : Mapper ,
348
+ options : CompilerOptions ,
325
349
) -> None :
326
350
"""Populate attribute and method declarations."""
327
351
info = cdef .info
@@ -468,7 +492,12 @@ def prepare_init_method(cdef: ClassDef, ir: ClassIR, module_name: str, mapper: M
468
492
469
493
470
494
def prepare_non_ext_class_def (
471
- path : str , module_name : str , cdef : ClassDef , errors : Errors , mapper : Mapper , options : CompilerOptions
495
+ path : str ,
496
+ module_name : str ,
497
+ cdef : ClassDef ,
498
+ errors : Errors ,
499
+ mapper : Mapper ,
500
+ options : CompilerOptions ,
472
501
) -> None :
473
502
ir = mapper .type_to_ir [cdef .info ]
474
503
info = cdef .info
0 commit comments