Skip to content

Commit 7b33d96

Browse files
committed
Fixing the fixing of the PEP8 for lambda functions. http://legacy.python.org/dev/peps/pep-0008/#programming-recommendations
1 parent a5eec52 commit 7b33d96

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
@@ -62,7 +62,7 @@ def calculate_checksum(self):
6262
:returns: The checksum for `self.ean`.
6363
:rtype: Integer
6464
"""
65-
def sum_(x, y): return lambda x, y: int(x) + int(y)
65+
def sum_(x, y): return int(x) + int(y)
6666
evensum = reduce(sum_, self.ean[::2])
6767
oddsum = reduce(sum_, self.ean[1::2])
6868
return (10 - ((evensum + oddsum * 3) % 10)) % 10
@@ -143,7 +143,7 @@ def calculate_checksum(self):
143143
:returns: The checksum for `self.ean`.
144144
:rtype: Integer
145145
"""
146-
def sum_(x, y): return lambda x, y: int(x) + int(y)
146+
def sum_(x, y): return int(x) + int(y)
147147
evensum = reduce(sum_, self.ean[::2])
148148
oddsum = reduce(sum_, self.ean[1::2])
149149
return (10 - ((evensum * 3 + oddsum) % 10)) % 10

0 commit comments

Comments
 (0)