Open a filename or use an open file.
Specifically, if f is a string, try to use it as an argument to open. Otherwise just yield it. In particular anything that is not a subclass of str will be passed through untouched.
str