Skip to content

Commit c0796a5

Browse files
pre-commit-ci[bot]jairov4
authored andcommitted
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent eb16941 commit c0796a5

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
@@ -101,7 +101,9 @@ def build_type_map(
101101
if mapper.type_to_ir[cdef.info].is_ext_class:
102102
prepare_class_def(module.path, module.fullname, cdef, errors, mapper, options)
103103
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+
)
105107

106108
# Prepare implicit attribute accessors as needed if an attribute overrides a property.
107109
for module, cdef in classes:
@@ -168,7 +170,11 @@ def get_module_func_defs(module: MypyFile) -> Iterable[FuncDef]:
168170

169171

170172
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,
172178
) -> FuncDecl:
173179
kind = (
174180
FUNC_STATICMETHOD
@@ -182,10 +188,17 @@ def prepare_func_def(
182188

183189

184190
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,
186197
) -> None:
187198
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+
)
189202
elif isinstance(node, Decorator):
190203
# TODO: do something about abstract methods here. Currently, they are handled just like
191204
# normal methods.
@@ -242,7 +255,12 @@ def can_subclass_builtin(builtin_base: str) -> bool:
242255

243256

244257
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,
246264
) -> None:
247265
"""Populate the interface-level information in a class IR.
248266
@@ -321,7 +339,13 @@ def prepare_class_def(
321339

322340

323341
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,
325349
) -> None:
326350
"""Populate attribute and method declarations."""
327351
info = cdef.info
@@ -468,7 +492,12 @@ def prepare_init_method(cdef: ClassDef, ir: ClassIR, module_name: str, mapper: M
468492

469493

470494
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,
472501
) -> None:
473502
ir = mapper.type_to_ir[cdef.info]
474503
info = cdef.info

0 commit comments

Comments
 (0)