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

R. David Murray rdmurray at bitdance.com
Sun May 24 19:54:46 CEST 2009


Georg Brandl <g.brandl at gmx.net> wrote:
> George Sakkis schrieb:
> > On Fri, May 22, 2009 at 8:01 PM, Tarek Ziadé <ziade.tarek-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org> wrote:
> >> On Sat, May 23, 2009 at 1:46 AM, Georg Brandl <g.brandl at gmx.net> wrote:
> >>>>
> >>>> os.listdir(os.curdir)  <-> os.listdir()
> >>>
> >>> This seems to be a nice case of EIBTI to me.
> >>
> >> I would rather call that a default behavior, otherwise every function
> >> with arguments that have default
> >> values would be nice cases of EIBTI.
> 
> If a default value is there, it should be obvious.  In this case, my feeling
> was that it wasn't, but thinking about it I don't really see another default,
> so +0.
> 
> > Agreed, nobody writes "dir ." or "ls .", the implicit argument is obvious.
> 
> Well, the interactive shell shouldn't be considered a programming language,
> and even if you do, it's hardly Pythonic :)

Ah, but in unix the interactive shell _is_ a programming language. :)
But no, it isn't very pythonic, in many areas.

--David




More information about the Python-ideas mailing list