Skip to content

Commit c4a81ae

Browse files
don't shadow builtin
1 parent 34fef64 commit c4a81ae

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

python/egglog/runtime.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -583,17 +583,17 @@ def _defined_method(self: RuntimeExpr, *args, __name: str = name, **kwargs):
583583
define_expr_method(name)
584584

585585

586-
for name, reversed in itertools.product(NUMERIC_BINARY_METHODS, (False, True)):
586+
for name, r_method in itertools.product(NUMERIC_BINARY_METHODS, (False, True)):
587587

588-
def _numeric_binary_method(self: object, other: object, name: str = name, reversed: bool = reversed) -> object:
588+
def _numeric_binary_method(self: object, other: object, name: str = name, r_method: bool = r_method) -> object:
589589
"""
590590
Implements numeric binary operations.
591591
592592
Tries to find the minimum cost conversion of either the LHS or the RHS, by finding all methods with either
593593
the LHS or the RHS as exactly the right type and then upcasting the other to that type.
594594
"""
595-
# 1. switch if reversed
596-
if reversed:
595+
# 1. switch if reversed method
596+
if r_method:
597597
self, other = other, self
598598
# If the types don't exactly match to start, then we need to try converting one of them, by finding the cheapest conversion
599599
if not (
@@ -646,7 +646,7 @@ def _numeric_binary_method(self: object, other: object, name: str = name, revers
646646
fn = RuntimeFunction(Thunk.value(self.__egg_decls__), Thunk.value(method_ref), self)
647647
return fn(other)
648648

649-
method_name = f"__r{name[2:]}" if reversed else name
649+
method_name = f"__r{name[2:]}" if r_method else name
650650
setattr(RuntimeExpr, method_name, _numeric_binary_method)
651651

652652

0 commit comments

Comments
 (0)