It's not uncommon to see Python libraries that expose a universal "opener" function, that accept as their primary argument a string that could either represent a local filename (which it will open and operate on), a URL(which it will download and operate on), or data(which it will operate on).
Here's an example from Feedparser.
My question is: is there a standard "right" way to do that? Or, A module that implements that bit of functionality (maybe as a decorator)?