Skip to content

Commit dd3f791

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 3afff6e commit dd3f791

File tree

3 files changed

+39
-9
lines changed

3 files changed

+39
-9
lines changed

mypyc/irbuild/function.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@
9292
from mypyc.primitives.registry import builtin_names
9393
from mypyc.sametype import is_same_method_signature, is_same_type
9494

95-
9695
# Top-level transform functions
9796

9897

mypyc/irbuild/ll_builder.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1431,7 +1431,9 @@ def dunder_op(self, lreg: Value, rreg: Value | None, op: str, line: int) -> Valu
14311431
if not is_binary and len(decl.sig.args) != 1:
14321432
return None
14331433

1434-
if is_binary and (len(decl.sig.args) != 2 or not is_subtype(rreg.type, decl.sig.args[1].type)):
1434+
if is_binary and (
1435+
len(decl.sig.args) != 2 or not is_subtype(rreg.type, decl.sig.args[1].type)
1436+
):
14351437
return None
14361438

14371439
if is_binary and is_subtype(not_implemented_op.type, decl.sig.ret_type):

mypyc/irbuild/prepare.py

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ def build_type_map(
9797
if mapper.type_to_ir[cdef.info].is_ext_class:
9898
prepare_class_def(module.path, module.fullname, cdef, errors, mapper, options)
9999
else:
100-
prepare_non_ext_class_def(module.path, module.fullname, cdef, errors, mapper, options)
100+
prepare_non_ext_class_def(
101+
module.path, module.fullname, cdef, errors, mapper, options
102+
)
101103

102104
# Prepare implicit attribute accessors as needed if an attribute overrides a property.
103105
for module, cdef in classes:
@@ -164,7 +166,11 @@ def get_module_func_defs(module: MypyFile) -> Iterable[FuncDef]:
164166

165167

166168
def prepare_func_def(
167-
module_name: str, class_name: str | None, fdef: FuncDef, mapper: Mapper, options: CompilerOptions
169+
module_name: str,
170+
class_name: str | None,
171+
fdef: FuncDef,
172+
mapper: Mapper,
173+
options: CompilerOptions,
168174
) -> FuncDecl:
169175
kind = (
170176
FUNC_STATICMETHOD
@@ -178,10 +184,17 @@ def prepare_func_def(
178184

179185

180186
def prepare_method_def(
181-
ir: ClassIR, module_name: str, cdef: ClassDef, mapper: Mapper, node: FuncDef | Decorator, options: CompilerOptions
187+
ir: ClassIR,
188+
module_name: str,
189+
cdef: ClassDef,
190+
mapper: Mapper,
191+
node: FuncDef | Decorator,
192+
options: CompilerOptions,
182193
) -> None:
183194
if isinstance(node, FuncDef):
184-
ir.method_decls[node.name] = prepare_func_def(module_name, cdef.name, node, mapper, options)
195+
ir.method_decls[node.name] = prepare_func_def(
196+
module_name, cdef.name, node, mapper, options
197+
)
185198
elif isinstance(node, Decorator):
186199
# TODO: do something about abstract methods here. Currently, they are handled just like
187200
# normal methods.
@@ -238,7 +251,12 @@ def can_subclass_builtin(builtin_base: str) -> bool:
238251

239252

240253
def prepare_class_def(
241-
path: str, module_name: str, cdef: ClassDef, errors: Errors, mapper: Mapper, options: CompilerOptions
254+
path: str,
255+
module_name: str,
256+
cdef: ClassDef,
257+
errors: Errors,
258+
mapper: Mapper,
259+
options: CompilerOptions,
242260
) -> None:
243261
"""Populate the interface-level information in a class IR.
244262
@@ -317,7 +335,13 @@ def prepare_class_def(
317335

318336

319337
def prepare_methods_and_attributes(
320-
cdef: ClassDef, ir: ClassIR, path: str, module_name: str, errors: Errors, mapper: Mapper, options: CompilerOptions
338+
cdef: ClassDef,
339+
ir: ClassIR,
340+
path: str,
341+
module_name: str,
342+
errors: Errors,
343+
mapper: Mapper,
344+
options: CompilerOptions,
321345
) -> None:
322346
"""Populate attribute and method declarations."""
323347
info = cdef.info
@@ -464,7 +488,12 @@ def prepare_init_method(cdef: ClassDef, ir: ClassIR, module_name: str, mapper: M
464488

465489

466490
def prepare_non_ext_class_def(
467-
path: str, module_name: str, cdef: ClassDef, errors: Errors, mapper: Mapper, options: CompilerOptions
491+
path: str,
492+
module_name: str,
493+
cdef: ClassDef,
494+
errors: Errors,
495+
mapper: Mapper,
496+
options: CompilerOptions,
468497
) -> None:
469498
ir = mapper.type_to_ir[cdef.info]
470499
info = cdef.info

0 commit comments

Comments
 (0)