Skip to content

Commit

Permalink
Replace operation lambdas with coreesponding operator functions
Browse files Browse the repository at this point in the history
  • Loading branch information
heldev committed Jan 23, 2018
1 parent ee15b59 commit 900a578
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions execute_operation.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
from collections import Counter
import operator

from sublime import Region
from sublime_plugin import TextCommand


OPERATIONS = {
'sum': lambda a, b: a + b,
'union': lambda a, b: a | b,
'intersection': lambda a, b: a & b,
'difference': lambda a, b: a - b,
'sum': operator.add,
'union': operator.or_,
'intersection': operator.and_,
'difference': operator.sub,
'symmetric_difference': lambda a, b: (a | b) - (a & b)}


Expand Down

0 comments on commit 900a578

Please sign in to comment.