Tim Chase wrote: > def dir_iter(root): > for fullpath in ( > os.path.join(path, dir_) > for path, dirs, files in os.walk(root) > for dir_ in dirs > ): > if os.path.isdir(fullpath): > yield fullpath Why did you add an explicit isdir() check? My understanding is that the names in dirs are known to be directories.