PEP ? os.listdir enhancement

Daniel Dittmar daniel.dittmar at sap.corp
Thu Jun 23 13:25:06 CEST 2005

Riccardo Galli wrote:
> On Thu, 23 Jun 2005 12:56:08 +0300, Konstantin Veretennicov wrote:
>>What about os.listdir(dir='relative/path', abs=True)? Should listdir call
>>abspath on results? Should we add another keyword rel? Would it complicate
>>listdir unnecessarily?
> keyword dir not exists (don't know if you added as example or not) and
> abs set to true would return abspath on result. What else could it do ?

He probably meant that a 'join' option would be more natural than an 
'abs' option. After all, your examples use os.path.join to create a 
valid path that can be used as the argument to other module os 
functions. Whether the results are absolute or relative should depend on 
the initial argument to os.listdir.


More information about the Python-list mailing list