`file_names.append` is bad because of 2 reasons:

1) it puts `filename` to the end of the list (previously it was the first name to look for), so this change is not backwards-compatible;
2) if passed file_names is a list then append changes it (and we shouldn't); if passed file_names is a tuple then it will raise an exception.

I also think duplicates are harmless here, and it is up to user not to pass duplicate items. What about rewriting these 2 lines this way?

```
file_names = [filename] + (file_names or [])
```

---

Using a single list makes sense, +1 from me. But I don't understand the reason why some of the code below exists (I'll leave a comment), so we probably need somebody who touched it (@xim?) to confirm changes.