Skip to content

Commit 1080baa

Browse files
committed
Fixing the PEP8 for lambda functions.
1 parent 13fce49 commit 1080baa

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

barcode/ean.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def calculate_checksum(self):
5959
:returns: The checksum for `self.ean`.
6060
:rtype: Integer
6161
"""
62-
sum_ = lambda x, y: int(x) + int(y)
62+
def sum_(x, y): return lambda x, y: int(x) + int(y)
6363
evensum = reduce(sum_, self.ean[::2])
6464
oddsum = reduce(sum_, self.ean[1::2])
6565
return (10 - ((evensum + oddsum * 3) % 10)) % 10
@@ -140,7 +140,7 @@ def calculate_checksum(self):
140140
:returns: The checksum for `self.ean`.
141141
:rtype: Integer
142142
"""
143-
sum_ = lambda x, y: int(x) + int(y)
143+
def sum_(x, y): return lambda x, y: int(x) + int(y)
144144
evensum = reduce(sum_, self.ean[::2])
145145
oddsum = reduce(sum_, self.ean[1::2])
146146
return (10 - ((evensum * 3 + oddsum) % 10)) % 10

0 commit comments

Comments
 (0)