Identity is not the same things as equality in Python
This commit is contained in:
parent
d6f40dfcdf
commit
7f34998dab
@ -54,7 +54,7 @@ def main():
|
|||||||
line = line.strip()
|
line = line.strip()
|
||||||
items.append(line)
|
items.append(line)
|
||||||
# When no more items, blank line or new header
|
# 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.
|
# 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]):
|
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.
|
# write the ordered list to the temporary file.
|
||||||
|
@ -54,7 +54,7 @@ def main():
|
|||||||
line = line.strip()
|
line = line.strip()
|
||||||
items.append(line)
|
items.append(line)
|
||||||
# When no more items, blank line or new header
|
# 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.
|
# 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]):
|
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.
|
# write the ordered list to the temporary file.
|
||||||
|
@ -54,7 +54,7 @@ def main():
|
|||||||
line = line.strip()
|
line = line.strip()
|
||||||
items.append(line)
|
items.append(line)
|
||||||
# When no more items, blank line or new header
|
# 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.
|
# 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]):
|
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.
|
# write the ordered list to the temporary file.
|
||||||
|
Loading…
Reference in New Issue
Block a user