properly exclude basestring and file from iterable detection