Merge pull request #450 from cclauss/identity-vs-equality

Identity is not the same things as equality in Python
This commit is contained in:
Luong Vo 2019-08-01 23:21:07 +07:00 committed by GitHub
commit f0d5b00758
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -54,7 +54,7 @@ def main():
line = line.strip()
items.append(line)
# When no more items, blank line or new header
elif line is '\n':
elif line == '\n':
# when we meet the next header, we should stop adding new item to the list.
for item in sorted(items, key=lambda x: regex.findall(x.upper())[len(regex.findall(x.upper()))-1]):
# write the ordered list to the temporary file.

View File

@ -54,7 +54,7 @@ def main():
line = line.strip()
items.append(line)
# When no more items, blank line or new header
elif line is '\n':
elif line == '\n':
# when we meet the next header, we should stop adding new item to the list.
for item in sorted(items, key=lambda x: regex.findall(x.upper())[len(regex.findall(x.upper()))-1]):
# write the ordered list to the temporary file.

View File

@ -54,7 +54,7 @@ def main():
line = line.strip()
items.append(line)
# When no more items, blank line or new header
elif line is '\n':
elif line == '\n':
# when we meet the next header, we should stop adding new item to the list.
for item in sorted(items, key=lambda x: regex.findall(x.upper())[len(regex.findall(x.upper()))-1]):
# write the ordered list to the temporary file.