internetarchive / fatcat-scholar

search interface for scholarly works
https://scholar.archive.org
Other
78 stars 14 forks source link

str.endswith() can take a tuple of suffixes to look for #59

Closed cclauss closed 2 years ago

cclauss commented 3 years ago

https://docs.python.org/3/library/stdtypes.html#str.endswith

bnewbold commented 2 years ago

Interesting, I didn't know about this syntax!

At least in this specific case, where the suffixes are a single character, I find the code with multiple strings kind of confusing. I would expect it to be trying to match a list-of-tuples and matching if the last element of the list was the given tuple. Or, it could also be misinterpreted as being the same as raw.endswith(":!?") or something.

So, I would lean towards not merging this. But maybe I am just old-fashioned? I do really appreciate your taking the time to look over the code base and do cleanups. I'm tempted to just merge-by-default.