flesh wound while built-in type iterables are bound to specific type of value generationthe concept is similar to the multipurpose generators we code with expressions and functions iteration contexts like for loops accept any iterable that has the expected methodswhether user-defined or built-in generators and library toolsdirectory walkers though beyond this book' scopemany python standard library tools generate values today tooincluding email parsersand the standard directory walker--which at each level of tree yields tuple of the current directoryits subdirectoriesand its filesimport os for (rootsubsfilesin os walk(')for name in filesif name startswith('call')print(rootnamedirectory walk generator python 'findoperation callables py \dualpkg callables py in factos walk is coded as recursive function in python in its os py standard library filein :\python \lib on windows because it uses yield (and in yield from instead of for loopto return resultsit' normal generator functionand hence an iterable objectg os walk( ' :\code\pkg'iter(gis single-scan iteratoriter(goptional true iter(gnext( (' :\\code\\pkg'['__pycache__']['eggs py''eggs pyc''main py'etc ]next( (' :\\code\\pkg\\__pycache__'[]['eggs cpython- pyc'etc ]next(istopiteration by yielding results as it goesthe walker does not require its clients to wait for an entire tree to be scanned see python' manuals and follow-up books such as programming python for more on this tool also see and others for os popen-- related iterable used to run shell command and read its output generators and function application in we noted that starred arguments can unpack an iterable into individual arguments now that we've seen generatorswe can also see what this means in code in both and (though ' range is list)def (abc)print('% %sand % (abc) ( normal positionals generator functions and expressions