Skip to content
Snippets Groups Projects
Commit 555a6a83 authored by Richard Angersbach's avatar Richard Angersbach
Browse files

Reformat reduction.py

parent a16969bf
1 merge request!438Reduction Support
This commit is part of merge request !438. Comments created here will be created in the context of that merge request.
......@@ -12,7 +12,7 @@ class ReducedAssignment(AssignmentBase):
Symbol for binary operation being applied in the assignment, such as "+",
"*", etc.
"""
binop = None # type: str
binop = None # type: str
@property
def op(self):
......@@ -22,6 +22,7 @@ class ReducedAssignment(AssignmentBase):
class AddReducedAssignment(ReducedAssignment):
binop = '+'
class SubReducedAssignment(ReducedAssignment):
binop = '-'
......@@ -33,6 +34,7 @@ class MulReducedAssignment(ReducedAssignment):
class MinReducedssignment(ReducedAssignment):
binop = 'min'
class MaxReducedssignment(ReducedAssignment):
binop = 'max'
......@@ -45,7 +47,8 @@ reduced_assign_classes = {
]
}
def reduced_assign(lhs, op, rhs):
if op not in reduced_assign_classes:
raise ValueError("Unrecognized operator %s" % op)
return reduced_assign_classes[op](lhs, rhs)
\ No newline at end of file
return reduced_assign_classes[op](lhs, rhs)
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment