"Basilisk96" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | "Terry Reedy" <[EMAIL PROTECTED]> wrote: | > Any what if 'filelist' is any iterable other than a string or list? Your | > code is broken, and unnecessarily so. So I would call the parameter | > 'files' and test for isinstance(files, str) #or basestring. And wrap if it | > is. | | Can you give an example of such an iterable (other than a tuple)?
Tuple was the first thing I thought of, and one will break the list test. The next would be an iterator that walks a file hierarchy spitting out the names of non-directory files, or all files with a certain extension, or all files with a certain owner, or timestamp characteristic. | I'd certainly like to fix my 'fix' to work for a more general case. As I said, I think it as simple as changing 'not list' to 'is string'. tjr -- http://mail.python.org/mailman/listinfo/python-list