Skip to content

Commit 1986403

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

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

mypyc/irbuild/ll_builder.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2448,7 +2448,11 @@ def builtin_len(self, val: Value, line: int, use_pyssize_t: bool = False) -> Val
24482448
class_ir = typ.class_ir
24492449

24502450
# Only optimize for native extension classes (not built-in base, not Python subclass)
2451-
if class_ir.is_ext_class and not class_ir.inherits_python and class_ir.has_method("__len__"):
2451+
if (
2452+
class_ir.is_ext_class
2453+
and not class_ir.inherits_python
2454+
and class_ir.has_method("__len__")
2455+
):
24522456
# 1. Direct C call for final native methods and exact type
24532457
if class_ir.is_method_final("__len__"):
24542458
decl = class_ir.method_decl("__len__")

0 commit comments

Comments
 (0)