[Python-ideas] os.listdir with current working directory as default

Georg Brandl g.brandl at gmx.net
Sat May 23 01:46:08 CEST 2009


Tarek Ziadé schrieb:
> On Sat, May 23, 2009 at 1:16 AM, Georg Brandl <g.brandl-hi6Y0CQ0nG0 at public.gmane.org> wrote:
>> Antoine Pitrou schrieb:
>>> Tarek Ziadé <ziade.tarek at ...> writes:
>>>>
>>>> A very small change: what about making the path argument optional for
>>>> os.listdir ? and use the current working directory if
>>>> not provided.
>>>
>>> Disagreed. If you want the current directory, you just have to use ".".
>>
>> or os.curdir to be precise :)
> 
> yes, same question then, make these equivalent:
> 
> os.listdir(os.curdir)  <-> os.listdir()

This seems to be a nice case of EIBTI to me.

Georg

-- 
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.




More information about the Python-ideas mailing list